From 75018632a9b953aafeae6f4e8aea607fd1d89dca Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Wed, 6 Sep 2017 18:28:12 +0100 Subject: Use coccinelle to change logging macro calls in c files for F in $(git ls-files '*.c');do spatch --sp-file foo.cocci --in-place ${F};done @@ expression E; @@ -LOG(E); +NSLOG(netsurf, INFO, E); @@ expression E, E1; @@ -LOG(E, E1); +NSLOG(netsurf, INFO, E, E1); @@ expression E, E1, E2; @@ -LOG(E, E1, E2); +NSLOG(netsurf, INFO, E, E1, E2); @@ expression E, E1, E2, E3; @@ -LOG(E, E1, E2, E3); +NSLOG(netsurf, INFO, E, E1, E2, E3); @@ expression E, E1, E2, E3, E4; @@ -LOG(E, E1, E2, E3, E4); +NSLOG(netsurf, INFO, E, E1, E2, E3, E4); @@ expression E, E1, E2, E3, E4, E5; @@ -LOG(E, E1, E2, E3, E4, E5); +NSLOG(netsurf, INFO, E, E1, E2, E3, E4, E5); @@ expression E, E1, E2, E3, E4, E5, E6; @@ -LOG(E, E1, E2, E3, E4, E5, E6); +NSLOG(netsurf, INFO, E, E1, E2, E3, E4, E5, E6); @@ expression E, E1, E2, E3, E4, E5, E6, E7; @@ -LOG(E, E1, E2, E3, E4, E5, E6, E7); +NSLOG(netsurf, INFO, E, E1, E2, E3, E4, E5, E6, E7); --- frontends/amiga/arexx.c | 2 +- frontends/amiga/bitmap.c | 12 +- frontends/amiga/cookies.c | 2 +- frontends/amiga/corewindow.c | 5 +- frontends/amiga/drag.c | 3 +- frontends/amiga/dt_anim.c | 14 +- frontends/amiga/dt_picture.c | 6 +- frontends/amiga/dt_sound.c | 17 +-- frontends/amiga/filetype.c | 8 +- frontends/amiga/font.c | 12 +- frontends/amiga/font_bullet.c | 21 ++- frontends/amiga/font_cache.c | 14 +- frontends/amiga/font_diskfont.c | 4 +- frontends/amiga/font_scan.c | 24 ++-- frontends/amiga/gui.c | 79 ++++++----- frontends/amiga/gui_menu.c | 3 +- frontends/amiga/history.c | 2 +- frontends/amiga/history_local.c | 2 +- frontends/amiga/hotlist.c | 2 +- frontends/amiga/memory.c | 73 ++++++---- frontends/amiga/misc.c | 2 +- frontends/amiga/os3support.c | 18 +-- frontends/amiga/plotters.c | 29 ++-- frontends/amiga/plugin_hack.c | 20 +-- frontends/amiga/schedule.c | 11 +- frontends/amiga/selectmenu.c | 3 +- frontends/amiga/sslcert.c | 2 +- frontends/atari/bitmap.c | 32 +++-- frontends/atari/certview.c | 16 +-- frontends/atari/cookies.c | 15 +- frontends/atari/ctxmenu.c | 7 +- frontends/atari/deskmenu.c | 64 +++++---- frontends/atari/download.c | 14 +- frontends/atari/filetype.c | 4 +- frontends/atari/findfile.c | 18 +-- frontends/atari/gui.c | 55 ++++---- frontends/atari/history.c | 15 +- frontends/atari/hotlist.c | 21 +-- frontends/atari/osspec.c | 6 +- frontends/atari/plot/font_freetype.c | 23 ++-- frontends/atari/plot/font_internal.c | 2 +- frontends/atari/plot/font_vdi.c | 2 +- frontends/atari/plot/plot.c | 5 +- frontends/atari/rootwin.c | 45 +++--- frontends/atari/schedule.c | 25 ++-- frontends/atari/search.c | 12 +- frontends/atari/settings.c | 6 +- frontends/atari/statusbar.c | 4 +- frontends/atari/toolbar.c | 15 +- frontends/atari/treeview.c | 6 +- frontends/atari/verify_ssl.c | 8 +- frontends/framebuffer/bitmap.c | 11 +- frontends/framebuffer/clipboard.c | 4 +- frontends/framebuffer/convert_font.c | 198 ++++++++++++++------------- frontends/framebuffer/fbtk/event.c | 4 +- frontends/framebuffer/fbtk/fbtk.c | 22 +-- frontends/framebuffer/fbtk/scroll.c | 4 +- frontends/framebuffer/fetch.c | 2 +- frontends/framebuffer/font_freetype.c | 19 ++- frontends/framebuffer/framebuffer.c | 15 +- frontends/framebuffer/gui.c | 39 +++--- frontends/framebuffer/schedule.c | 6 +- frontends/gtk/cookies.c | 7 +- frontends/gtk/corewindow.c | 4 +- frontends/gtk/download.c | 2 +- frontends/gtk/fetch.c | 3 +- frontends/gtk/gdk.c | 2 +- frontends/gtk/global_history.c | 7 +- frontends/gtk/gui.c | 65 +++++---- frontends/gtk/hotlist.c | 7 +- frontends/gtk/layout_pango.c | 4 +- frontends/gtk/local_history.c | 2 +- frontends/gtk/login.c | 2 +- frontends/gtk/plotters.c | 4 +- frontends/gtk/preferences.c | 11 +- frontends/gtk/print.c | 28 ++-- frontends/gtk/resources.c | 50 ++++--- frontends/gtk/scaffolding.c | 33 +++-- frontends/gtk/schedule.c | 14 +- frontends/gtk/ssl_cert.c | 2 +- frontends/gtk/tabs.c | 8 +- frontends/gtk/throbber.c | 6 +- frontends/gtk/toolbar.c | 5 +- frontends/gtk/viewdata.c | 23 ++-- frontends/gtk/window.c | 27 ++-- frontends/monkey/browser.c | 2 +- frontends/monkey/dispatch.c | 2 +- frontends/monkey/filetype.c | 3 +- frontends/monkey/main.c | 8 +- frontends/monkey/schedule.c | 7 +- frontends/riscos/401login.c | 5 +- frontends/riscos/bitmap.c | 32 +++-- frontends/riscos/buffer.c | 36 +++-- frontends/riscos/configure.c | 32 +++-- frontends/riscos/configure/con_language.c | 6 +- frontends/riscos/configure/con_theme.c | 23 ++-- frontends/riscos/content-handlers/artworks.c | 32 +++-- frontends/riscos/content-handlers/draw.c | 6 +- frontends/riscos/content-handlers/sprite.c | 5 +- frontends/riscos/cookies.c | 4 +- frontends/riscos/corewindow.c | 97 ++++++------- frontends/riscos/dialog.c | 53 ++++--- frontends/riscos/download.c | 152 ++++++++++++++------ frontends/riscos/filetype.c | 37 +++-- frontends/riscos/font.c | 75 ++++++---- frontends/riscos/global_history.c | 4 +- frontends/riscos/gui.c | 116 ++++++++++------ frontends/riscos/gui/button_bar.c | 30 ++-- frontends/riscos/gui/progress_bar.c | 18 ++- frontends/riscos/gui/status_bar.c | 62 ++++++--- frontends/riscos/gui/throbber.c | 11 +- frontends/riscos/gui/url_bar.c | 48 ++++--- frontends/riscos/help.c | 22 ++- frontends/riscos/hotlist.c | 7 +- frontends/riscos/iconbar.c | 6 +- frontends/riscos/image.c | 20 ++- frontends/riscos/local_history.c | 47 +++---- frontends/riscos/menus.c | 31 +++-- frontends/riscos/message.c | 8 +- frontends/riscos/mouse.c | 5 +- frontends/riscos/plotters.c | 104 ++++++++------ frontends/riscos/print.c | 77 +++++++---- frontends/riscos/query.c | 21 ++- frontends/riscos/save.c | 116 +++++++++++----- frontends/riscos/save_draw.c | 12 +- frontends/riscos/schedule.c | 2 +- frontends/riscos/sslcert.c | 36 ++--- frontends/riscos/textarea.c | 127 +++++++++++------ frontends/riscos/textselection.c | 38 +++-- frontends/riscos/theme.c | 44 ++++-- frontends/riscos/theme_install.c | 5 +- frontends/riscos/toolbar.c | 48 +++++-- frontends/riscos/ucstables.c | 7 +- frontends/riscos/uri.c | 6 +- frontends/riscos/url_complete.c | 66 ++++++--- frontends/riscos/url_protocol.c | 19 ++- frontends/riscos/wimp.c | 135 ++++++++++++------ frontends/riscos/wimp_event.c | 76 +++++++--- frontends/riscos/window.c | 193 +++++++++++++++++--------- frontends/windows/about.c | 8 +- frontends/windows/bitmap.c | 32 +++-- frontends/windows/corewindow.c | 10 +- frontends/windows/download.c | 8 +- frontends/windows/drawable.c | 30 ++-- frontends/windows/filetype.c | 2 +- frontends/windows/findfile.c | 4 +- frontends/windows/gui.c | 4 +- frontends/windows/main.c | 13 +- frontends/windows/plot.c | 18 +-- frontends/windows/prefs.c | 3 +- frontends/windows/schedule.c | 6 +- frontends/windows/ssl_cert.c | 11 +- frontends/windows/window.c | 84 +++++++----- 153 files changed, 2412 insertions(+), 1455 deletions(-) (limited to 'frontends') diff --git a/frontends/amiga/arexx.c b/frontends/amiga/arexx.c index 7bb2f5882..9484ee92b 100644 --- a/frontends/amiga/arexx.c +++ b/frontends/amiga/arexx.c @@ -173,7 +173,7 @@ void ami_arexx_execute(char *script) if((lock = Lock(script, ACCESS_READ))) { DevNameFromLock(lock, full_script_path, 1024, DN_FULLPATH); - LOG("Executing script: %s", full_script_path); + NSLOG(netsurf, INFO, "Executing script: %s", full_script_path); ami_arexx_command(full_script_path, NULL); UnLock(lock); } diff --git a/frontends/amiga/bitmap.c b/frontends/amiga/bitmap.c index 533b416fa..757b55965 100644 --- a/frontends/amiga/bitmap.c +++ b/frontends/amiga/bitmap.c @@ -161,7 +161,10 @@ static void amiga_bitmap_unmap_buffer(void *p) struct bitmap *bm = p; if((nsoption_bool(use_extmem) == true) && (bm->pixdata != NULL)) { - LOG("Unmapping ExtMem object %p for bitmap %p", bm->iextmem, bm); + NSLOG(netsurf, INFO, + "Unmapping ExtMem object %p for bitmap %p", + bm->iextmem, + bm); bm->iextmem->Unmap(bm->pixdata, bm->size); bm->pixdata = NULL; } @@ -176,7 +179,10 @@ unsigned char *amiga_bitmap_get_buffer(void *bitmap) #ifdef __amigaos4__ if(nsoption_bool(use_extmem) == true) { if(bm->pixdata == NULL) { - LOG("Mapping ExtMem object %p for bitmap %p", bm->iextmem, bm); + NSLOG(netsurf, INFO, + "Mapping ExtMem object %p for bitmap %p", + bm->iextmem, + bm); bm->pixdata = bm->iextmem->Map(NULL, bm->size, 0LL, 0); } @@ -723,7 +729,7 @@ void ami_bitmap_fini(void) static nserror bitmap_render(struct bitmap *bitmap, struct hlcache_handle *content) { #ifdef __amigaos4__ - LOG("Entering bitmap_render"); + NSLOG(netsurf, INFO, "Entering bitmap_render"); int plot_width; int plot_height; diff --git a/frontends/amiga/cookies.c b/frontends/amiga/cookies.c index fd71a9c2a..45e883fde 100644 --- a/frontends/amiga/cookies.c +++ b/frontends/amiga/cookies.c @@ -364,7 +364,7 @@ nserror ami_cookies_present(void) res = ami_cookies_create_window(ncwin); if (res != NSERROR_OK) { - LOG("SSL UI builder init failed"); + NSLOG(netsurf, INFO, "SSL UI builder init failed"); ami_utf8_free(ncwin->core.wintitle); free(ncwin); return res; diff --git a/frontends/amiga/corewindow.c b/frontends/amiga/corewindow.c index 1a94dd3b2..243146a3a 100644 --- a/frontends/amiga/corewindow.c +++ b/frontends/amiga/corewindow.c @@ -315,7 +315,7 @@ static void ami_cw_redraw_queue(struct ami_corewindow *ami_cw, bool draw) if(IsMinListEmpty(ami_cw->deferred_rects)) return; if(draw == false) { - LOG("Ignoring deferred box redraw queue"); + NSLOG(netsurf, INFO, "Ignoring deferred box redraw queue"); } // else should probably show busy pointer node = (struct nsObject *)GetHead((struct List *)ami_cw->deferred_rects); @@ -378,7 +378,8 @@ ami_cw_redraw(struct ami_corewindow *ami_cw, const struct rect *restrict r) nsobj = AddObject(ami_cw->deferred_rects, AMINS_RECT); nsobj->objstruct = deferred_rect; } else { - LOG("Ignoring duplicate or subset of queued box redraw"); + NSLOG(netsurf, INFO, + "Ignoring duplicate or subset of queued box redraw"); } ami_schedule(1, ami_cw_redraw_cb, ami_cw); } diff --git a/frontends/amiga/drag.c b/frontends/amiga/drag.c index a8d3aa9f9..ec0ee3c6a 100644 --- a/frontends/amiga/drag.c +++ b/frontends/amiga/drag.c @@ -188,7 +188,8 @@ void ami_drag_save(struct Window *win) break; default: - LOG("Unsupported drag save operation %d", drag_save); + NSLOG(netsurf, INFO, + "Unsupported drag save operation %d", drag_save); break; } diff --git a/frontends/amiga/dt_anim.c b/frontends/amiga/dt_anim.c index 2493c41ee..bd049206c 100644 --- a/frontends/amiga/dt_anim.c +++ b/frontends/amiga/dt_anim.c @@ -162,7 +162,7 @@ nserror amiga_dt_anim_create(const content_handler *handler, bool amiga_dt_anim_convert(struct content *c) { - LOG("amiga_dt_anim_convert"); + NSLOG(netsurf, INFO, "amiga_dt_anim_convert"); amiga_dt_anim_content *plugin = (amiga_dt_anim_content *) c; union content_msg_data msg_data; @@ -246,7 +246,7 @@ void amiga_dt_anim_destroy(struct content *c) { amiga_dt_anim_content *plugin = (amiga_dt_anim_content *) c; - LOG("amiga_dt_anim_destroy"); + NSLOG(netsurf, INFO, "amiga_dt_anim_destroy"); if (plugin->bitmap != NULL) amiga_bitmap_destroy(plugin->bitmap); @@ -263,7 +263,7 @@ bool amiga_dt_anim_redraw(struct content *c, amiga_dt_anim_content *plugin = (amiga_dt_anim_content *) c; bitmap_flags_t flags = BITMAPF_NONE; - LOG("amiga_dt_anim_redraw"); + NSLOG(netsurf, INFO, "amiga_dt_anim_redraw"); if (data->repeat_x) flags |= BITMAPF_REPEAT_X; @@ -290,20 +290,20 @@ bool amiga_dt_anim_redraw(struct content *c, void amiga_dt_anim_open(struct content *c, struct browser_window *bw, struct content *page, struct object_params *params) { - LOG("amiga_dt_anim_open"); + NSLOG(netsurf, INFO, "amiga_dt_anim_open"); return; } void amiga_dt_anim_close(struct content *c) { - LOG("amiga_dt_anim_close"); + NSLOG(netsurf, INFO, "amiga_dt_anim_close"); return; } void amiga_dt_anim_reformat(struct content *c, int width, int height) { - LOG("amiga_dt_anim_reformat"); + NSLOG(netsurf, INFO, "amiga_dt_anim_reformat"); return; } @@ -312,7 +312,7 @@ nserror amiga_dt_anim_clone(const struct content *old, struct content **newc) amiga_dt_anim_content *plugin; nserror error; - LOG("amiga_dt_anim_clone"); + NSLOG(netsurf, INFO, "amiga_dt_anim_clone"); plugin = calloc(1, sizeof(amiga_dt_anim_content)); if (plugin == NULL) diff --git a/frontends/amiga/dt_picture.c b/frontends/amiga/dt_picture.c index 73f6c47c1..88ce1c834 100644 --- a/frontends/amiga/dt_picture.c +++ b/frontends/amiga/dt_picture.c @@ -174,7 +174,7 @@ static char *amiga_dt_picture_datatype(struct content *c) static struct bitmap *amiga_dt_picture_cache_convert(struct content *c) { - LOG("amiga_dt_picture_cache_convert"); + NSLOG(netsurf, INFO, "amiga_dt_picture_cache_convert"); union content_msg_data msg_data; UBYTE *bm_buffer; @@ -210,7 +210,7 @@ static struct bitmap *amiga_dt_picture_cache_convert(struct content *c) bool amiga_dt_picture_convert(struct content *c) { - LOG("amiga_dt_picture_convert"); + NSLOG(netsurf, INFO, "amiga_dt_picture_convert"); int width, height; char *title; @@ -256,7 +256,7 @@ nserror amiga_dt_picture_clone(const struct content *old, struct content **newc) struct content *adt; nserror error; - LOG("amiga_dt_picture_clone"); + NSLOG(netsurf, INFO, "amiga_dt_picture_clone"); adt = calloc(1, sizeof(struct content)); if (adt == NULL) diff --git a/frontends/amiga/dt_sound.c b/frontends/amiga/dt_sound.c index eda60edc1..e0f48da83 100644 --- a/frontends/amiga/dt_sound.c +++ b/frontends/amiga/dt_sound.c @@ -76,7 +76,7 @@ static const content_handler amiga_dt_sound_content_handler = { static void amiga_dt_sound_play(Object *dto) { - LOG("Playing..."); + NSLOG(netsurf, INFO, "Playing..."); IDoMethod(dto, DTM_TRIGGER, NULL, STM_PLAY, NULL); } @@ -126,7 +126,7 @@ nserror amiga_dt_sound_create(const content_handler *handler, amiga_dt_sound_content *plugin; nserror error; - LOG("amiga_dt_sound_create"); + NSLOG(netsurf, INFO, "amiga_dt_sound_create"); plugin = calloc(1, sizeof(amiga_dt_sound_content)); if (plugin == NULL) @@ -146,7 +146,7 @@ nserror amiga_dt_sound_create(const content_handler *handler, bool amiga_dt_sound_convert(struct content *c) { - LOG("amiga_dt_sound_convert"); + NSLOG(netsurf, INFO, "amiga_dt_sound_convert"); amiga_dt_sound_content *plugin = (amiga_dt_sound_content *) c; int width = 50, height = 50; @@ -180,7 +180,7 @@ void amiga_dt_sound_destroy(struct content *c) { amiga_dt_sound_content *plugin = (amiga_dt_sound_content *) c; - LOG("amiga_dt_sound_destroy"); + NSLOG(netsurf, INFO, "amiga_dt_sound_destroy"); DisposeDTObject(plugin->dto); @@ -199,7 +199,7 @@ bool amiga_dt_sound_redraw(struct content *c, }; struct rect rect; - LOG("amiga_dt_sound_redraw"); + NSLOG(netsurf, INFO, "amiga_dt_sound_redraw"); rect.x0 = data->x; rect.y0 = data->y; @@ -226,7 +226,7 @@ void amiga_dt_sound_open(struct content *c, struct browser_window *bw, amiga_dt_sound_content *plugin = (amiga_dt_sound_content *) c; struct object_param *param; - LOG("amiga_dt_sound_open"); + NSLOG(netsurf, INFO, "amiga_dt_sound_open"); plugin->immediate = false; @@ -234,7 +234,8 @@ void amiga_dt_sound_open(struct content *c, struct browser_window *bw, { do { - LOG("%s = %s", param->name, param->value); + NSLOG(netsurf, INFO, "%s = %s", param->name, + param->value); if((strcmp(param->name, "autoplay") == 0) && (strcmp(param->value, "true") == 0)) plugin->immediate = true; if((strcmp(param->name, "autoStart") == 0) && @@ -255,7 +256,7 @@ nserror amiga_dt_sound_clone(const struct content *old, struct content **newc) amiga_dt_sound_content *plugin; nserror error; - LOG("amiga_dt_sound_clone"); + NSLOG(netsurf, INFO, "amiga_dt_sound_clone"); plugin = calloc(1, sizeof(amiga_dt_sound_content)); if (plugin == NULL) diff --git a/frontends/amiga/filetype.c b/frontends/amiga/filetype.c index a0449d848..0e535de07 100644 --- a/frontends/amiga/filetype.c +++ b/frontends/amiga/filetype.c @@ -185,7 +185,7 @@ nserror ami_mime_init(const char *mimefile) struct nsObject *node; struct ami_mime_entry *mimeentry; - LOG("mimetypes file: %s", mimefile); + NSLOG(netsurf, INFO, "mimetypes file: %s", mimefile); if(ami_mime_list == NULL) ami_mime_list = NewObjList(); @@ -642,6 +642,10 @@ void ami_mime_dump(void) struct ami_mime_entry *mimeentry; while((mimeentry = ami_mime_entry_locate(NULL, AMI_MIME_MIMETYPE, &node))) { - LOG("%s DT=\"%s\" TYPE=\"%s\" CMD=\"%s\"", mimeentry->mimetype ? lwc_string_data(mimeentry->mimetype) : "", mimeentry->datatype ? lwc_string_data(mimeentry->datatype) : "", mimeentry->filetype ? lwc_string_data(mimeentry->filetype) : "", mimeentry->plugincmd ? lwc_string_data(mimeentry->plugincmd) : ""); + NSLOG(netsurf, INFO, "%s DT=\"%s\" TYPE=\"%s\" CMD=\"%s\"", + mimeentry->mimetype ? lwc_string_data(mimeentry->mimetype) : "", + mimeentry->datatype ? lwc_string_data(mimeentry->datatype) : "", + mimeentry->filetype ? lwc_string_data(mimeentry->filetype) : "", + mimeentry->plugincmd ? lwc_string_data(mimeentry->plugincmd) : ""); }; } diff --git a/frontends/amiga/font.c b/frontends/amiga/font.c index 22a0f4a4a..63172623f 100644 --- a/frontends/amiga/font.c +++ b/frontends/amiga/font.c @@ -51,7 +51,8 @@ void ami_font_setdevicedpi(int id) struct DisplayInfo dinfo; if(nsoption_bool(bitmap_fonts) == true) { - LOG("WARNING: Using diskfont.library for text. Forcing DPI to 72."); + NSLOG(netsurf, INFO, + "WARNING: Using diskfont.library for text. Forcing DPI to 72."); nsoption_set_int(screen_ydpi, 72); } @@ -79,7 +80,14 @@ void ami_font_setdevicedpi(int id) xdpi = (yres * ydpi) / xres; - LOG("XDPI = %ld, YDPI = %ld (DisplayInfo resolution %d x %d, corrected %d x %d)", xdpi, ydpi, dinfo.Resolution.x, dinfo.Resolution.y, xres, yres); + NSLOG(netsurf, INFO, + "XDPI = %ld, YDPI = %ld (DisplayInfo resolution %d x %d, corrected %d x %d)", + xdpi, + ydpi, + dinfo.Resolution.x, + dinfo.Resolution.y, + xres, + yres); } } } diff --git a/frontends/amiga/font_bullet.c b/frontends/amiga/font_bullet.c index fd41c29a2..c8ad34c04 100644 --- a/frontends/amiga/font_bullet.c +++ b/frontends/amiga/font_bullet.c @@ -361,7 +361,7 @@ static struct ami_font_cache_node *ami_font_open(const char *font, bool critical if(!nodedata->font) { - LOG("Requested font not found: %s", font); + NSLOG(netsurf, INFO, "Requested font not found: %s", font); if(critical == true) amiga_warn_user("CompError", font); free(nodedata); return NULL; @@ -369,21 +369,28 @@ static struct ami_font_cache_node *ami_font_open(const char *font, bool critical nodedata->bold = (char *)GetTagData(OT_BName, 0, nodedata->font->olf_OTagList); if(nodedata->bold) - LOG("Bold font defined for %s is %s", font, nodedata->bold); + NSLOG(netsurf, INFO, "Bold font defined for %s is %s", font, + nodedata->bold); else - LOG("Warning: No designed bold font defined for %s", font); + NSLOG(netsurf, INFO, + "Warning: No designed bold font defined for %s", font); nodedata->italic = (char *)GetTagData(OT_IName, 0, nodedata->font->olf_OTagList); if(nodedata->italic) - LOG("Italic font defined for %s is %s", font, nodedata->italic); + NSLOG(netsurf, INFO, "Italic font defined for %s is %s", + font, nodedata->italic); else - LOG("Warning: No designed italic font defined for %s", font); + NSLOG(netsurf, INFO, + "Warning: No designed italic font defined for %s", font); nodedata->bolditalic = (char *)GetTagData(OT_BIName, 0, nodedata->font->olf_OTagList); if(nodedata->bolditalic) - LOG("Bold-italic font defined for %s is %s", font, nodedata->bolditalic); + NSLOG(netsurf, INFO, "Bold-italic font defined for %s is %s", + font, nodedata->bolditalic); else - LOG("Warning: No designed bold-italic font defined for %s", font); + NSLOG(netsurf, INFO, + "Warning: No designed bold-italic font defined for %s", + font); ami_font_cache_insert(nodedata, font); return nodedata; diff --git a/frontends/amiga/font_cache.c b/frontends/amiga/font_cache.c index 3d8330979..86e2381c0 100644 --- a/frontends/amiga/font_cache.c +++ b/frontends/amiga/font_cache.c @@ -69,7 +69,10 @@ static void ami_font_cache_cleanup(struct SkipList *skiplist) SubTime(&curtime, &node->lastused); if(curtime.Seconds > 300) { - LOG("Freeing font %p not used for %ld seconds", node->skip_node.sn_Key, curtime.Seconds); + NSLOG(netsurf, INFO, + "Freeing font %p not used for %ld seconds", + node->skip_node.sn_Key, + curtime.Seconds); ami_font_bullet_close(node); RemoveSkipNode(skiplist, node->skip_node.sn_Key); } @@ -98,7 +101,10 @@ static void ami_font_cache_cleanup(struct MinList *ami_font_cache_list) SubTime(&curtime, &fnode->lastused); if(curtime.Seconds > 300) { - LOG("Freeing %s not used for %ld seconds", node->dtz_Node.ln_Name, curtime.Seconds); + NSLOG(netsurf, INFO, + "Freeing %s not used for %ld seconds", + node->dtz_Node.ln_Name, + curtime.Seconds); DelObject(node); } } while((node=nnode)); @@ -146,7 +152,7 @@ struct ami_font_cache_node *ami_font_cache_locate(const char *font) return nodedata; } - LOG("Font cache miss: %s (%lx)", font, hash); + NSLOG(netsurf, INFO, "Font cache miss: %s (%lx)", font, hash); return NULL; } @@ -180,7 +186,7 @@ void ami_font_cache_insert(struct ami_font_cache_node *nodedata, const char *fon void ami_font_cache_fini(void) { - LOG("Cleaning up font cache"); + NSLOG(netsurf, INFO, "Cleaning up font cache"); ami_schedule(-1, (void *)ami_font_cache_cleanup, ami_font_cache_list); #ifdef __amigaos4__ ami_font_cache_del_skiplist(ami_font_cache_list); diff --git a/frontends/amiga/font_diskfont.c b/frontends/amiga/font_diskfont.c index 7abc4379b..658829237 100644 --- a/frontends/amiga/font_diskfont.c +++ b/frontends/amiga/font_diskfont.c @@ -55,7 +55,7 @@ static struct TextFont *ami_font_bm_open(struct RastPort *rp, const plot_font_st (fstyle->size == prev_fstyle->size) && (fstyle->flags == prev_fstyle->flags) && (fstyle->weight == prev_fstyle->weight)) { - LOG("(using current font)"); + NSLOG(netsurf, INFO, "(using current font)"); return prev_font; } @@ -99,7 +99,7 @@ static struct TextFont *ami_font_bm_open(struct RastPort *rp, const plot_font_st snprintf(font, MAX_FONT_NAME_SIZE, "%s.font", fontname); tattr.ta_Name = font; tattr.ta_YSize = fstyle->size / FONT_SIZE_SCALE; - LOG("font: %s/%d", tattr.ta_Name, tattr.ta_YSize); + NSLOG(netsurf, INFO, "font: %s/%d", tattr.ta_Name, tattr.ta_YSize); if(prev_font != NULL) CloseFont(prev_font); diff --git a/frontends/amiga/font_scan.c b/frontends/amiga/font_scan.c index 932179e3e..cb37f97fa 100644 --- a/frontends/amiga/font_scan.c +++ b/frontends/amiga/font_scan.c @@ -255,7 +255,8 @@ static ULONG ami_font_scan_font(const char *fontname, lwc_string **glypharray) #ifdef __amigaos4__ if(EObtainInfo(AMI_OFONT_ENGINE, OT_UnicodeRanges, &unicoderanges, TAG_END) == 0) { if(unicoderanges & UCR_SURROGATES) { - LOG("%s supports UTF-16 surrogates", fontname); + NSLOG(netsurf, INFO, "%s supports UTF-16 surrogates", + fontname); if (nsoption_charp(font_surrogate) == NULL) { nsoption_set_charp(font_surrogate, (char *)strdup(fontname)); } @@ -292,10 +293,11 @@ static ULONG ami_font_scan_fonts(struct MinList *list, do { nnode = (struct nsObject *)GetSucc((struct Node *)node); ami_font_scan_gui_update(win, node->dtz_Node.ln_Name, font_num, total); - LOG("Scanning %s", node->dtz_Node.ln_Name); + NSLOG(netsurf, INFO, "Scanning %s", node->dtz_Node.ln_Name); found = ami_font_scan_font(node->dtz_Node.ln_Name, glypharray); total += found; - LOG("Found %ld new glyphs (total = %ld)", found, total); + NSLOG(netsurf, INFO, "Found %ld new glyphs (total = %ld)", + found, total); font_num++; } while((node = nnode)); @@ -344,7 +346,9 @@ static ULONG ami_font_scan_list(struct MinList *list) if(node) { node->dtz_Node.ln_Name = strdup(af[i].af_Attr.ta_Name); found++; - LOG("Added %s", af[i].af_Attr.ta_Name); + NSLOG(netsurf, INFO, + "Added %s", + af[i].af_Attr.ta_Name); } } } @@ -382,7 +386,8 @@ static ULONG ami_font_scan_load(const char *filename, lwc_string **glypharray) rargs = AllocDosObjectTags(DOS_RDARGS, TAG_DONE); if((fh = FOpen(filename, MODE_OLDFILE, 0))) { - LOG("Loading font glyph cache from %s", filename); + NSLOG(netsurf, INFO, "Loading font glyph cache from %s", + filename); while(FGets(fh, (STRPTR)&buffer, 256) != 0) { @@ -423,7 +428,8 @@ void ami_font_scan_save(const char *filename, lwc_string **glypharray) BPTR fh = 0; if((fh = FOpen(filename, MODE_NEWFILE, 0))) { - LOG("Writing font glyph cache to %s", filename); + NSLOG(netsurf, INFO, "Writing font glyph cache to %s", + filename); FPrintf(fh, "; This file is auto-generated. To re-create the cache, delete this file.\n"); FPrintf(fh, "; This file is parsed using ReadArgs() with the following template:\n"); FPrintf(fh, "; CODE/A,FONT/A\n;\n"); @@ -482,7 +488,7 @@ void ami_font_scan_init(const char *filename, bool force_scan, bool save, found = ami_font_scan_load(filename, glypharray); if(found == 0) { - LOG("Creating new font glyph cache"); + NSLOG(netsurf, INFO, "Creating new font glyph cache"); if((list = NewObjList())) { /* add preferred fonts list */ @@ -504,7 +510,7 @@ void ami_font_scan_init(const char *filename, bool force_scan, bool save, if(nsoption_bool(font_unicode_only) == false) entries += ami_font_scan_list(list); - LOG("Found %ld fonts", entries); + NSLOG(netsurf, INFO, "Found %ld fonts", entries); win = ami_font_scan_gui_open(entries); found = ami_font_scan_fonts(list, win, glypharray); @@ -517,6 +523,6 @@ void ami_font_scan_init(const char *filename, bool force_scan, bool save, } } - LOG("Initialised with %ld glyphs", found); + NSLOG(netsurf, INFO, "Initialised with %ld glyphs", found); } diff --git a/frontends/amiga/gui.c b/frontends/amiga/gui.c index 44bba2d90..387c2151c 100644 --- a/frontends/amiga/gui.c +++ b/frontends/amiga/gui.c @@ -342,7 +342,9 @@ bool ami_gui_map_filename(char **remapped, const char *restrict path, } if(found == false) *remapped = strdup(file); - else LOG("Remapped %s to %s in path %s using %s", file, *remapped, path, map); + else NSLOG(netsurf, INFO, + "Remapped %s to %s in path %s using %s", file, + *remapped, path, map); free(mapfile); @@ -365,7 +367,7 @@ static bool ami_gui_check_resource(char *fullpath, const char *file) found = true; } - if(found) LOG("Found %s", fullpath); + if(found) NSLOG(netsurf, INFO, "Found %s", fullpath); free(remapped); return found; @@ -842,7 +844,7 @@ static void ami_openscreen(void) } if(screen_signal == -1) screen_signal = AllocSignal(-1); - LOG("Screen signal %d", screen_signal); + NSLOG(netsurf, INFO, "Screen signal %d", screen_signal); scrn = OpenScreenTags(NULL, /**\todo specify screen depth */ SA_DisplayID, id, @@ -918,19 +920,22 @@ static struct RDArgs *ami_gui_commandline(int *restrict argc, char ** argv, if((args = ReadArgs(template, rarray, NULL))) { if(rarray[A_URL]) { - LOG("URL %s specified on command line", - (char *)rarray[A_URL]); + NSLOG(netsurf, INFO, + "URL %s specified on command line", + (char *)rarray[A_URL]); temp_homepage_url = strdup((char *)rarray[A_URL]); /**\todo allow IDNs */ } if(rarray[A_USERSDIR]) { - LOG("USERSDIR %s specified on command line", - (char *)rarray[A_USERSDIR]); + NSLOG(netsurf, INFO, + "USERSDIR %s specified on command line", + (char *)rarray[A_USERSDIR]); users_dir = ASPrintf("%s", rarray[A_USERSDIR]); } if(rarray[A_FORCE]) { - LOG("FORCE specified on command line"); + NSLOG(netsurf, INFO, + "FORCE specified on command line"); cli_force = true; } @@ -950,7 +955,7 @@ static struct RDArgs *ami_gui_commandline(int *restrict argc, char ** argv, */ } } else { - LOG("ReadArgs failed to parse command line"); + NSLOG(netsurf, INFO, "ReadArgs failed to parse command line"); } FreeArgs(args); @@ -2790,7 +2795,9 @@ static void ami_handle_applib(void) { struct ApplicationCustomMsg *applibcustmsg = (struct ApplicationCustomMsg *)applibmsg; - LOG("Ringhio BackMsg received: %s", applibcustmsg->customMsg); + NSLOG(netsurf, INFO, + "Ringhio BackMsg received: %s", + applibcustmsg->customMsg); ami_download_parse_backmsg(applibcustmsg->customMsg); } @@ -2826,7 +2833,7 @@ void ami_get_msg(void) NULL, (unsigned int *)&signalmask) != -1) { signal = signalmask; } else { - LOG("waitselect() returned error"); + NSLOG(netsurf, INFO, "waitselect() returned error"); /* \todo Fix Ctrl-C handling. * WaitSelect() from bsdsocket.library returns -1 if the task was * signalled with a Ctrl-C. waitselect() from newlib.library does not. @@ -3035,11 +3042,13 @@ static void ami_gui_close_screen(struct Screen *scrn, BOOL locked_screen, BOOL d if(donotwait == TRUE) return; ULONG scrnsig = 1 << screen_signal; - LOG("Waiting for visitor windows to close... (signal)"); + NSLOG(netsurf, INFO, + "Waiting for visitor windows to close... (signal)"); Wait(scrnsig); while (CloseScreen(scrn) == FALSE) { - LOG("Waiting for visitor windows to close... (polling)"); + NSLOG(netsurf, INFO, + "Waiting for visitor windows to close... (polling)"); Delay(50); } @@ -3081,11 +3090,11 @@ static void gui_quit(void) ami_font_fini(); ami_help_free(); - LOG("Freeing menu items"); + NSLOG(netsurf, INFO, "Freeing menu items"); ami_ctxmenu_free(); ami_menu_free_glyphs(); - LOG("Freeing mouse pointers"); + NSLOG(netsurf, INFO, "Freeing mouse pointers"); ami_mouse_pointers_free(); ami_file_req_free(); @@ -3099,7 +3108,7 @@ static void gui_quit(void) ami_clipboard_free(); ami_gui_resources_free(); - LOG("Closing screen"); + NSLOG(netsurf, INFO, "Closing screen"); ami_gui_close_screen(scrn, locked_screen, FALSE); if(nsscreentitle) FreeVec(nsscreentitle); } @@ -3109,7 +3118,7 @@ char *ami_gui_get_cache_favicon_name(nsurl *url, bool only_if_avail) STRPTR filename = NULL; if ((filename = ASPrintf("%s/%x", current_user_faviconcache, nsurl_hash(url)))) { - LOG("favicon cache location: %s", filename); + NSLOG(netsurf, INFO, "favicon cache location: %s", filename); if (only_if_avail == true) { BPTR lock = 0; @@ -3723,7 +3732,8 @@ static nserror amiga_window_invalidate_area(struct gui_window *g, nsobj = AddObject(g->deferred_rects, AMINS_RECT); nsobj->objstruct = deferred_rect; } else { - LOG("Ignoring duplicate or subset of queued box redraw"); + NSLOG(netsurf, INFO, + "Ignoring duplicate or subset of queued box redraw"); } } ami_schedule_redraw(g->shared, false); @@ -3912,7 +3922,7 @@ gui_window_create(struct browser_window *bw, ULONG defer_layout = TRUE; ULONG idcmp_sizeverify = IDCMP_SIZEVERIFY; - LOG("Creating window"); + NSLOG(netsurf, INFO, "Creating window"); if (!scrn) ami_openscreenfirst(); @@ -4056,7 +4066,7 @@ gui_window_create(struct browser_window *bw, (strcmp(nsoption_charp(pubscreen_name), "Workbench") == 0)) iconifygadget = TRUE; - LOG("Creating menu"); + NSLOG(netsurf, INFO, "Creating menu"); struct Menu *menu = ami_gui_menu_create(g->shared); NewList(&g->shared->tab_list); @@ -4178,7 +4188,7 @@ gui_window_create(struct browser_window *bw, BitMapEnd; } - LOG("Creating window object"); + NSLOG(netsurf, INFO, "Creating window object"); g->shared->objects[OID_MAIN] = WindowObj, WA_ScreenTitle, ami_gui_get_screen_title(), @@ -4456,11 +4466,11 @@ gui_window_create(struct browser_window *bw, EndWindow; } - LOG("Opening window"); + NSLOG(netsurf, INFO, "Opening window"); g->shared->win = (struct Window *)RA_OpenWindow(g->shared->objects[OID_MAIN]); - LOG("Window opened, adding border gadgets"); + NSLOG(netsurf, INFO, "Window opened, adding border gadgets"); if(!g->shared->win) { @@ -4796,7 +4806,7 @@ static void ami_gui_window_update_box_deferred(struct gui_window *g, bool draw) if(draw == true) { ami_set_pointer(g->shared, GUI_POINTER_WAIT, false); } else { - LOG("Ignoring deferred box redraw queue"); + NSLOG(netsurf, INFO, "Ignoring deferred box redraw queue"); } node = (struct nsObject *)GetHead((struct List *)g->deferred_rects); @@ -4841,7 +4851,8 @@ bool ami_gui_window_update_box_deferred_check(struct MinList *deferred_rects, (new_rect->y0 <= rect->y0) && (new_rect->x1 >= rect->x1) && (new_rect->y1 >= rect->y1)) { - LOG("Removing queued redraw that is a subset of new box redraw"); + NSLOG(netsurf, INFO, + "Removing queued redraw that is a subset of new box redraw"); ami_memory_itempool_free(mempool, node->objstruct, sizeof(struct rect)); DelObjectNoFree(node); /* Don't return - we might find more */ @@ -5414,20 +5425,20 @@ Object *ami_gui_splash_open(void) EndWindow; if(win_obj == NULL) { - LOG("Splash window object not created"); + NSLOG(netsurf, INFO, "Splash window object not created"); return NULL; } - LOG("Attempting to open splash window..."); + NSLOG(netsurf, INFO, "Attempting to open splash window..."); win = RA_OpenWindow(win_obj); if(win == NULL) { - LOG("Splash window did not open"); + NSLOG(netsurf, INFO, "Splash window did not open"); return NULL; } if(bm_obj == NULL) { - LOG("BitMap object not created"); + NSLOG(netsurf, INFO, "BitMap object not created"); return NULL; } @@ -5489,14 +5500,14 @@ void ami_gui_splash_close(Object *win_obj) { if(win_obj == NULL) return; - LOG("Closing splash window"); + NSLOG(netsurf, INFO, "Closing splash window"); DisposeObject(win_obj); } static void gui_file_gadget_open(struct gui_window *g, struct hlcache_handle *hl, struct form_control *gadget) { - LOG("File open dialog request for %p/%p", g, gadget); + NSLOG(netsurf, INFO, "File open dialog request for %p/%p", g, gadget); if(AslRequestTags(filereq, ASLFR_Window, g->shared->win, @@ -5531,7 +5542,7 @@ static char *ami_gui_get_user_dir(STRPTR current_user) user = GetVar("user", temp, 1024, GVF_GLOBAL_ONLY); current_user = ASPrintf("%s", (user == -1) ? "Default" : temp); } - LOG("User: %s", current_user); + NSLOG(netsurf, INFO, "User: %s", current_user); if(users_dir == NULL) { users_dir = ASPrintf("%s", USERS_DIR); @@ -5583,7 +5594,7 @@ static char *ami_gui_get_user_dir(STRPTR current_user) FreeVec(users_dir); FreeVec(current_user); - LOG("User dir: %s", current_user_dir); + NSLOG(netsurf, INFO, "User dir: %s", current_user_dir); if((lock = CreateDirTree(current_user_dir))) UnLock(lock); @@ -5810,7 +5821,7 @@ int main(int argc, char** argv) AddPart(script, nsoption_charp(arexx_startup), 1024); ami_arexx_execute(script); - LOG("Entering main loop"); + NSLOG(netsurf, INFO, "Entering main loop"); while (!ami_quit) { ami_get_msg(); diff --git a/frontends/amiga/gui_menu.c b/frontends/amiga/gui_menu.c index 6ee0800f8..756f5e66c 100644 --- a/frontends/amiga/gui_menu.c +++ b/frontends/amiga/gui_menu.c @@ -584,7 +584,8 @@ ULONG ami_gui_menu_number(int item) break; default: - LOG("WARNING: Unrecognised menu item %d", item); + NSLOG(netsurf, INFO, + "WARNING: Unrecognised menu item %d", item); menu_num = 0; break; } diff --git a/frontends/amiga/history.c b/frontends/amiga/history.c index 7fc1ec333..e724f3e70 100644 --- a/frontends/amiga/history.c +++ b/frontends/amiga/history.c @@ -438,7 +438,7 @@ nserror ami_history_global_present(void) res = ami_history_global_create_window(ncwin); if (res != NSERROR_OK) { - LOG("SSL UI builder init failed"); + NSLOG(netsurf, INFO, "SSL UI builder init failed"); ami_utf8_free(ncwin->core.wintitle); free(ncwin); return res; diff --git a/frontends/amiga/history_local.c b/frontends/amiga/history_local.c index c293f5909..0ae9cc040 100644 --- a/frontends/amiga/history_local.c +++ b/frontends/amiga/history_local.c @@ -261,7 +261,7 @@ nserror ami_history_local_present(struct gui_window *gw) res = ami_history_local_create_window(ncwin); if (res != NSERROR_OK) { - LOG("SSL UI builder init failed"); + NSLOG(netsurf, INFO, "SSL UI builder init failed"); ami_utf8_free(ncwin->core.wintitle); free(ncwin); return res; diff --git a/frontends/amiga/hotlist.c b/frontends/amiga/hotlist.c index c0a6b6f58..c7efe9148 100644 --- a/frontends/amiga/hotlist.c +++ b/frontends/amiga/hotlist.c @@ -563,7 +563,7 @@ nserror ami_hotlist_present(void) res = ami_hotlist_create_window(ncwin); if (res != NSERROR_OK) { - LOG("SSL UI builder init failed"); + NSLOG(netsurf, INFO, "SSL UI builder init failed"); ami_utf8_free(ncwin->core.wintitle); free(ncwin); return res; diff --git a/frontends/amiga/memory.c b/frontends/amiga/memory.c index d371d2585..35ca9697f 100755 --- a/frontends/amiga/memory.c +++ b/frontends/amiga/memory.c @@ -50,23 +50,38 @@ void *ami_memory_clear_alloc(size_t size, UBYTE value) static int ami_memory_slab_usage_cb(const struct __slab_usage_information * sui) { if(sui->sui_slab_index <= 1) { - LOG("clib2 slab usage:"); - LOG(" The size of all slabs, in bytes: %ld", sui->sui_slab_size); - LOG(" Number of allocations which are not managed by slabs: %ld", - sui->sui_num_single_allocations); - LOG(" Total number of bytes allocated for memory not managed by slabs: %ld", - sui->sui_total_single_allocation_size); - LOG(" Number of slabs currently in play: %ld", sui->sui_num_slabs); - LOG(" Number of currently unused slabs: %ld", sui->sui_num_empty_slabs); - LOG(" Number of slabs in use which are completely filled with data: %ld", - sui->sui_num_full_slabs); - LOG(" Total number of bytes allocated for all slabs: %ld", - sui->sui_total_slab_allocation_size); + NSLOG(netsurf, INFO, "clib2 slab usage:"); + NSLOG(netsurf, INFO, + " The size of all slabs, in bytes: %ld", + sui->sui_slab_size); + NSLOG(netsurf, INFO, + " Number of allocations which are not managed by slabs: %ld", + sui->sui_num_single_allocations); + NSLOG(netsurf, INFO, + " Total number of bytes allocated for memory not managed by slabs: %ld", + sui->sui_total_single_allocation_size); + NSLOG(netsurf, INFO, + " Number of slabs currently in play: %ld", + sui->sui_num_slabs); + NSLOG(netsurf, INFO, + " Number of currently unused slabs: %ld", + sui->sui_num_empty_slabs); + NSLOG(netsurf, INFO, + " Number of slabs in use which are completely filled with data: %ld", + sui->sui_num_full_slabs); + NSLOG(netsurf, INFO, + " Total number of bytes allocated for all slabs: %ld", + sui->sui_total_slab_allocation_size); } - LOG("Slab %d", sui->sui_slab_index); - LOG(" Memory chunk size managed by this slab: %ld", sui->sui_chunk_size); - LOG(" Number of memory chunks that fit in this slab: %ld", sui->sui_num_chunks); - LOG(" Number of memory chunks used in this slab: %ld", sui->sui_num_chunks_used); + NSLOG(netsurf, INFO, "Slab %d", sui->sui_slab_index); + NSLOG(netsurf, INFO, " Memory chunk size managed by this slab: %ld", + sui->sui_chunk_size); + NSLOG(netsurf, INFO, + " Number of memory chunks that fit in this slab: %ld", + sui->sui_num_chunks); + NSLOG(netsurf, INFO, + " Number of memory chunks used in this slab: %ld", + sui->sui_num_chunks_used); return 0; } @@ -74,16 +89,20 @@ static int ami_memory_slab_usage_cb(const struct __slab_usage_information * sui) static int ami_memory_slab_alloc_cb(const struct __slab_allocation_information *sai) { if(sai->sai_allocation_index <= 1) { - LOG("clib2 allocation usage:"); - LOG(" Number of allocations which are not managed by slabs: %ld", - sai->sai_num_single_allocations); - LOG(" Total number of bytes allocated for memory not managed by slabs: %ld", - sai->sai_total_single_allocation_size); + NSLOG(netsurf, INFO, "clib2 allocation usage:"); + NSLOG(netsurf, INFO, + " Number of allocations which are not managed by slabs: %ld", + sai->sai_num_single_allocations); + NSLOG(netsurf, INFO, + " Total number of bytes allocated for memory not managed by slabs: %ld", + sai->sai_total_single_allocation_size); } - LOG("Alloc %d", sai->sai_allocation_index); - LOG(" Size of this allocation, as requested: %ld", sai->sai_allocation_size); - LOG(" Total size of this allocation, including management data: %ld", - sai->sai_total_allocation_size); + NSLOG(netsurf, INFO, "Alloc %d", sai->sai_allocation_index); + NSLOG(netsurf, INFO, " Size of this allocation, as requested: %ld", + sai->sai_allocation_size); + NSLOG(netsurf, INFO, + " Total size of this allocation, including management data: %ld", + sai->sai_total_allocation_size); return 0; } @@ -111,13 +130,13 @@ void ami_memory_slab_dump(BPTR fh) static void ami_memory_low_mem_handler(void *p) { if(low_mem_status == PURGE_STEP1) { - LOG("Purging llcache"); + NSLOG(netsurf, INFO, "Purging llcache"); llcache_clean(true); low_mem_status = PURGE_DONE_STEP1; } if(low_mem_status == PURGE_STEP2) { - LOG("Purging unused slabs"); + NSLOG(netsurf, INFO, "Purging unused slabs"); __free_unused_slabs(); low_mem_status = PURGE_DONE_STEP2; } diff --git a/frontends/amiga/misc.c b/frontends/amiga/misc.c index 5ca4f906a..532d2f182 100755 --- a/frontends/amiga/misc.c +++ b/frontends/amiga/misc.c @@ -46,7 +46,7 @@ static LONG ami_misc_req(const char *message, uint32 type) { LONG ret = 0; - LOG("%s", message); + NSLOG(netsurf, INFO, "%s", message); #ifdef __amigaos4__ ret = TimedDosRequesterTags( TDR_TitleString, messages_get("NetSurf"), diff --git a/frontends/amiga/os3support.c b/frontends/amiga/os3support.c index 6dc95795f..378bc04cc 100644 --- a/frontends/amiga/os3support.c +++ b/frontends/amiga/os3support.c @@ -216,13 +216,13 @@ struct OutlineFont *OpenOutlineFont(STRPTR fileName, struct List *list, ULONG fl fh = Open(fontpath, MODE_OLDFILE); if(fh == 0) { - LOG("Unable to open FONT %s", fontpath); + NSLOG(netsurf, INFO, "Unable to open FONT %s", fontpath); FreeVec(fontpath); return NULL; } if(Read(fh, &fch, sizeof(struct FontContentsHeader)) != sizeof(struct FontContentsHeader)) { - LOG("Unable to read FONT %s", fontpath); + NSLOG(netsurf, INFO, "Unable to read FONT %s", fontpath); FreeVec(fontpath); Close(fh); return NULL; @@ -231,7 +231,7 @@ struct OutlineFont *OpenOutlineFont(STRPTR fileName, struct List *list, ULONG fl Close(fh); if(fch.fch_FileID != OFCH_ID) { - LOG("%s is not an outline font!", fontpath); + NSLOG(netsurf, INFO, "%s is not an outline font!", fontpath); FreeVec(fontpath); return NULL; } @@ -242,7 +242,7 @@ struct OutlineFont *OpenOutlineFont(STRPTR fileName, struct List *list, ULONG fl if(p) *p = '.'; if(fh == 0) { - LOG("Unable to open OTAG %s", otagpath); + NSLOG(netsurf, INFO, "Unable to open OTAG %s", otagpath); FreeVec(otagpath); return NULL; } @@ -250,7 +250,7 @@ struct OutlineFont *OpenOutlineFont(STRPTR fileName, struct List *list, ULONG fl size = GetFileSize(fh); buffer = (UBYTE *)malloc(size); if(buffer == NULL) { - LOG("Unable to allocate memory"); + NSLOG(netsurf, INFO, "Unable to allocate memory"); Close(fh); FreeVec(otagpath); return NULL; @@ -262,7 +262,7 @@ struct OutlineFont *OpenOutlineFont(STRPTR fileName, struct List *list, ULONG fl /* The first tag is supposed to be OT_FileIdent and should equal 'size' */ struct TagItem *tag = (struct TagItem *)buffer; if((tag->ti_Tag != OT_FileIdent) || (tag->ti_Data != (ULONG)size)) { - LOG("Invalid OTAG file"); + NSLOG(netsurf, INFO, "Invalid OTAG file"); free(buffer); FreeVec(otagpath); return NULL; @@ -277,10 +277,10 @@ struct OutlineFont *OpenOutlineFont(STRPTR fileName, struct List *list, ULONG fl /* Find OT_Engine and open the font engine */ if(ti = FindTagItem(OT_Engine, buffer)) { - LOG("Using font engine %s", ti->ti_Data); + NSLOG(netsurf, INFO, "Using font engine %s", ti->ti_Data); fname = ASPrintf("%s.library", ti->ti_Data); } else { - LOG("Cannot find OT_Engine tag"); + NSLOG(netsurf, INFO, "Cannot find OT_Engine tag"); free(buffer); FreeVec(otagpath); return NULL; @@ -289,7 +289,7 @@ struct OutlineFont *OpenOutlineFont(STRPTR fileName, struct List *list, ULONG fl BulletBase = (struct BulletBase *)OpenLibrary(fname, 0L); if(BulletBase == NULL) { - LOG("Unable to open font engine %s", fname); + NSLOG(netsurf, INFO, "Unable to open font engine %s", fname); free(buffer); FreeVec(fname); FreeVec(otagpath); diff --git a/frontends/amiga/plotters.c b/frontends/amiga/plotters.c index e31d470a6..dc2c16724 100644 --- a/frontends/amiga/plotters.c +++ b/frontends/amiga/plotters.c @@ -131,7 +131,7 @@ struct gui_globals *ami_plot_ra_alloc(ULONG width, ULONG height, bool force32bit struct gui_globals *gg = malloc(sizeof(struct gui_globals)); if(force32bit == false) depth = GetBitMapAttr(scrn->RastPort.BitMap, BMA_DEPTH); - LOG("Screen depth = %d", depth); + NSLOG(netsurf, INFO, "Screen depth = %d", depth); #ifdef __amigaos4__ if(depth < 16) { @@ -241,7 +241,8 @@ struct gui_globals *ami_plot_ra_alloc(ULONG width, ULONG height, bool force32bit gg->open_num = -1; init_layers_count++; - LOG("Layer initialised (total: %d)", init_layers_count); + NSLOG(netsurf, INFO, "Layer initialised (total: %d)", + init_layers_count); return gg; } @@ -328,7 +329,8 @@ static ULONG ami_plot_obtain_pen(struct MinList *shared_pens, ULONG colr) (colr & 0x00ff0000) << 8, NULL); - if(pen == -1) LOG("WARNING: Cannot allocate pen for ABGR:%lx", colr); + if(pen == -1) NSLOG(netsurf, INFO, + "WARNING: Cannot allocate pen for ABGR:%lx", colr); if((shared_pens != NULL) && (pool_pens != NULL)) { if((node = (struct ami_plot_pen *)ami_memory_itempool_alloc(pool_pens, sizeof(struct ami_plot_pen)))) { @@ -849,17 +851,17 @@ ami_polygon(const struct redraw_context *ctx, ami_plot_setapen(glob, glob->rp, style->fill_colour); if (AreaMove(glob->rp,p[0],p[1]) == -1) { - LOG("AreaMove: vector list full"); + NSLOG(netsurf, INFO, "AreaMove: vector list full"); } for (uint32 k = 1; k < n; k++) { if (AreaDraw(glob->rp,p[k*2],p[(k*2)+1]) == -1) { - LOG("AreaDraw: vector list full"); + NSLOG(netsurf, INFO, "AreaDraw: vector list full"); } } if (AreaEnd(glob->rp) == -1) { - LOG("AreaEnd: error"); + NSLOG(netsurf, INFO, "AreaEnd: error"); } return NSERROR_OK; @@ -900,7 +902,7 @@ ami_path(const struct redraw_context *ctx, } if (p[0] != PLOTTER_PATH_MOVE) { - LOG("Path does not start with move"); + NSLOG(netsurf, INFO, "Path does not start with move"); return NSERROR_INVALID; } @@ -922,7 +924,8 @@ ami_path(const struct redraw_context *ctx, if (p[i] == PLOTTER_PATH_MOVE) { if (pstyle->fill_colour != NS_TRANSPARENT) { if (AreaMove(glob->rp, p[i+1], p[i+2]) == -1) { - LOG("AreaMove: vector list full"); + NSLOG(netsurf, INFO, + "AreaMove: vector list full"); } } else { Move(glob->rp, p[i+1], p[i+2]); @@ -936,7 +939,7 @@ ami_path(const struct redraw_context *ctx, } else if (p[i] == PLOTTER_PATH_CLOSE) { if (pstyle->fill_colour != NS_TRANSPARENT) { if (AreaEnd(glob->rp) == -1) { - LOG("AreaEnd: error"); + NSLOG(netsurf, INFO, "AreaEnd: error"); } } else { Draw(glob->rp, start_p.x, start_p.y); @@ -945,7 +948,8 @@ ami_path(const struct redraw_context *ctx, } else if (p[i] == PLOTTER_PATH_LINE) { if (pstyle->fill_colour != NS_TRANSPARENT) { if (AreaDraw(glob->rp, p[i+1], p[i+2]) == -1) { - LOG("AreaDraw: vector list full"); + NSLOG(netsurf, INFO, + "AreaDraw: vector list full"); } } else { Draw(glob->rp, p[i+1], p[i+2]); @@ -965,7 +969,8 @@ ami_path(const struct redraw_context *ctx, ami_bezier(&cur_p, &p_a, &p_b, &p_c, t, &p_r); if (pstyle->fill_colour != NS_TRANSPARENT) { if (AreaDraw(glob->rp, p_r.x, p_r.y) == -1) { - LOG("AreaDraw: vector list full"); + NSLOG(netsurf, INFO, + "AreaDraw: vector list full"); } } else { Draw(glob->rp, p_r.x, p_r.y); @@ -975,7 +980,7 @@ ami_path(const struct redraw_context *ctx, cur_p.y = p_c.y; i += 7; } else { - LOG("bad path command %f", p[i]); + NSLOG(netsurf, INFO, "bad path command %f", p[i]); /* End path for safety if using Area commands */ if (pstyle->fill_colour != NS_TRANSPARENT) { AreaEnd(glob->rp); diff --git a/frontends/amiga/plugin_hack.c b/frontends/amiga/plugin_hack.c index 2327f9190..4fd1f03f7 100644 --- a/frontends/amiga/plugin_hack.c +++ b/frontends/amiga/plugin_hack.c @@ -82,7 +82,8 @@ nserror amiga_plugin_hack_init(void) if(node) { - LOG("plugin_hack registered %s", lwc_string_data(type)); + NSLOG(netsurf, INFO, "plugin_hack registered %s", + lwc_string_data(type)); error = content_factory_register_handler( lwc_string_data(type), @@ -123,7 +124,7 @@ nserror amiga_plugin_hack_create(const content_handler *handler, bool amiga_plugin_hack_convert(struct content *c) { - LOG("amiga_plugin_hack_convert"); + NSLOG(netsurf, INFO, "amiga_plugin_hack_convert"); content_set_ready(c); content_set_done(c); @@ -137,7 +138,7 @@ void amiga_plugin_hack_destroy(struct content *c) { amiga_plugin_hack_content *plugin = (amiga_plugin_hack_content *) c; - LOG("amiga_plugin_hack_destroy %p", plugin); + NSLOG(netsurf, INFO, "amiga_plugin_hack_destroy %p", plugin); return; } @@ -155,7 +156,7 @@ bool amiga_plugin_hack_redraw(struct content *c, struct rect rect; nserror res; - LOG("amiga_plugin_hack_redraw"); + NSLOG(netsurf, INFO, "amiga_plugin_hack_redraw"); rect.x0 = data->x; rect.y0 = data->y; @@ -187,7 +188,8 @@ bool amiga_plugin_hack_redraw(struct content *c, void amiga_plugin_hack_open(struct content *c, struct browser_window *bw, struct content *page, struct object_params *params) { - LOG("amiga_plugin_hack_open %s", nsurl_access(content_get_url(c))); + NSLOG(netsurf, INFO, "amiga_plugin_hack_open %s", + nsurl_access(content_get_url(c))); if(c) { @@ -201,13 +203,13 @@ void amiga_plugin_hack_open(struct content *c, struct browser_window *bw, void amiga_plugin_hack_close(struct content *c) { - LOG("amiga_plugin_hack_close"); + NSLOG(netsurf, INFO, "amiga_plugin_hack_close"); return; } void amiga_plugin_hack_reformat(struct content *c, int width, int height) { - LOG("amiga_plugin_hack_reformat"); + NSLOG(netsurf, INFO, "amiga_plugin_hack_reformat"); c->width = width; c->height = height; @@ -220,7 +222,7 @@ nserror amiga_plugin_hack_clone(const struct content *old, struct content **newc amiga_plugin_hack_content *plugin; nserror error; - LOG("amiga_plugin_hack_clone"); + NSLOG(netsurf, INFO, "amiga_plugin_hack_clone"); plugin = calloc(1, sizeof(amiga_plugin_hack_content)); if (plugin == NULL) @@ -267,7 +269,7 @@ void amiga_plugin_hack_execute(struct hlcache_handle *c) if(full_cmd) { #ifdef __amigaos4__ - LOG("Attempting to execute %s", full_cmd); + NSLOG(netsurf, INFO, "Attempting to execute %s", full_cmd); in = Open("NIL:", MODE_OLDFILE); out = Open("NIL:", MODE_NEWFILE); diff --git a/frontends/amiga/schedule.c b/frontends/amiga/schedule.c index bfafe9c88..30a36815c 100644 --- a/frontends/amiga/schedule.c +++ b/frontends/amiga/schedule.c @@ -218,9 +218,10 @@ static void ami_schedule_dump(void) GetSysTime(&tv); Amiga2Date(tv.Seconds, &clockdata); - LOG("Current time = %d-%d-%d %d:%d:%d.%d", clockdata.mday, clockdata.month, clockdata.year, - clockdata.hour, clockdata.min, clockdata.sec, tv.Microseconds); - LOG("Events remaining in queue:"); + NSLOG(netsurf, INFO, "Current time = %d-%d-%d %d:%d:%d.%d", + clockdata.mday, clockdata.month, clockdata.year, + clockdata.hour, clockdata.min, clockdata.sec, tv.Microseconds); + NSLOG(netsurf, INFO, "Events remaining in queue:"); iterator = pblHeapIterator(schedule_list); @@ -231,9 +232,9 @@ static void ami_schedule_dump(void) nscb, clockdata.mday, clockdata.month, clockdata.year, clockdata.hour, clockdata.min, clockdata.sec, nscb->tv.Microseconds, nscb->callback, nscb->p); if(CheckIO((struct IORequest *)nscb) == NULL) { - LOG("-> ACTIVE"); + NSLOG(netsurf, INFO, "-> ACTIVE"); } else { - LOG("-> COMPLETE"); + NSLOG(netsurf, INFO, "-> COMPLETE"); } }; diff --git a/frontends/amiga/selectmenu.c b/frontends/amiga/selectmenu.c index f3a11b67a..8a8614136 100644 --- a/frontends/amiga/selectmenu.c +++ b/frontends/amiga/selectmenu.c @@ -58,7 +58,8 @@ BOOL ami_selectmenu_is_safe(void) BOOL popupmenu_lib_ok = FALSE; if((PopupMenuBase = OpenLibrary("popupmenu.library", 53))) { - LOG("popupmenu.library v%d.%d", PopupMenuBase->lib_Version, PopupMenuBase->lib_Revision); + NSLOG(netsurf, INFO, "popupmenu.library v%d.%d", + PopupMenuBase->lib_Version, PopupMenuBase->lib_Revision); if(LIB_IS_AT_LEAST((struct Library *)PopupMenuBase, 53, 11)) popupmenu_lib_ok = TRUE; CloseLibrary(PopupMenuBase); diff --git a/frontends/amiga/sslcert.c b/frontends/amiga/sslcert.c index eeb34108a..136b918fc 100644 --- a/frontends/amiga/sslcert.c +++ b/frontends/amiga/sslcert.c @@ -317,7 +317,7 @@ nserror ami_cert_verify(struct nsurl *url, res = ami_crtvrfy_create_window(ncwin); if (res != NSERROR_OK) { - LOG("SSL UI builder init failed"); + NSLOG(netsurf, INFO, "SSL UI builder init failed"); ami_utf8_free(ncwin->core.wintitle); ami_utf8_free(ncwin->sslerr); ami_utf8_free(ncwin->sslaccept); diff --git a/frontends/atari/bitmap.c b/frontends/atari/bitmap.c index cbb719586..ae42da837 100644 --- a/frontends/atari/bitmap.c +++ b/frontends/atari/bitmap.c @@ -81,7 +81,9 @@ static void *atari_bitmap_create_ex( int w, int h, short bpp, int rowstride, uns { struct bitmap * bitmap; - LOG("width %d (rowstride: %d, bpp: %d), height %d, state %u", w, rowstride, bpp, h, state); + NSLOG(netsurf, INFO, + "width %d (rowstride: %d, bpp: %d), height %d, state %u", w, + rowstride, bpp, h, state); if( rowstride == 0) { rowstride = bpp * w; @@ -107,10 +109,10 @@ static void *atari_bitmap_create_ex( int w, int h, short bpp, int rowstride, uns } else { free(bitmap); bitmap=NULL; - LOG("Out of memory!"); + NSLOG(netsurf, INFO, "Out of memory!"); } } - LOG("bitmap %p", bitmap); + NSLOG(netsurf, INFO, "bitmap %p", bitmap); return bitmap; } @@ -194,7 +196,7 @@ static unsigned char *bitmap_get_buffer(void *bitmap) struct bitmap *bm = bitmap; if (bitmap == NULL) { - LOG("NULL bitmap!"); + NSLOG(netsurf, INFO, "NULL bitmap!"); return NULL; } @@ -218,7 +220,7 @@ size_t atari_bitmap_get_rowstride(void *bitmap) struct bitmap *bm = bitmap; if (bitmap == NULL) { - LOG("NULL bitmap!"); + NSLOG(netsurf, INFO, "NULL bitmap!"); return 0; } return bm->rowstride; @@ -231,7 +233,7 @@ void atari_bitmap_destroy(void *bitmap) struct bitmap *bm = bitmap; if (bitmap == NULL) { - LOG("NULL bitmap!"); + NSLOG(netsurf, INFO, "NULL bitmap!"); return; } @@ -272,11 +274,12 @@ static void bitmap_set_opaque(void *bitmap, bool opaque) struct bitmap *bm = bitmap; if (bitmap == NULL) { - LOG("NULL bitmap!"); + NSLOG(netsurf, INFO, "NULL bitmap!"); return; } - LOG("setting bitmap %p to %s", bm, opaque ? "opaque" : "transparent"); + NSLOG(netsurf, INFO, "setting bitmap %p to %s", bm, + opaque ? "opaque" : "transparent"); bm->opaque = opaque; } @@ -293,7 +296,7 @@ static bool bitmap_test_opaque(void *bitmap) struct bitmap *bm = bitmap; if (bitmap == NULL) { - LOG("NULL bitmap!"); + NSLOG(netsurf, INFO, "NULL bitmap!"); return false; } @@ -305,11 +308,12 @@ static bool bitmap_test_opaque(void *bitmap) while (tst-- > 0) { if (bm->pixdata[(tst << 2) + 3] != 0xff) { - LOG("bitmap %p has transparency", bm); + NSLOG(netsurf, INFO, + "bitmap %p has transparency", bm); return false; } } - LOG("bitmap %p is opaque", bm); + NSLOG(netsurf, INFO, "bitmap %p is opaque", bm); return true; } @@ -320,7 +324,7 @@ bool atari_bitmap_get_opaque(void *bitmap) struct bitmap *bm = bitmap; if (bitmap == NULL) { - LOG("NULL bitmap!"); + NSLOG(netsurf, INFO, "NULL bitmap!"); return false; } @@ -334,7 +338,7 @@ int atari_bitmap_get_width(void *bitmap) struct bitmap *bm = bitmap; if (bitmap == NULL) { - LOG("NULL bitmap!"); + NSLOG(netsurf, INFO, "NULL bitmap!"); return 0; } @@ -348,7 +352,7 @@ int atari_bitmap_get_height(void *bitmap) struct bitmap *bm = bitmap; if (bitmap == NULL) { - LOG("NULL bitmap!"); + NSLOG(netsurf, INFO, "NULL bitmap!"); return 0; } return(bm->height); diff --git a/frontends/atari/certview.c b/frontends/atari/certview.c index 6950d31f8..80d18a059 100644 --- a/frontends/atari/certview.c +++ b/frontends/atari/certview.c @@ -81,7 +81,7 @@ static nserror atari_sslcert_viewer_init_phase2(struct core_window *cw, assert(ssl_d); - LOG("cw %p", cw); + NSLOG(netsurf, INFO, "cw %p", cw); return(sslcert_viewer_init(cb_t, cw, ssl_d)); } @@ -97,7 +97,7 @@ static void atari_sslcert_viewer_finish(struct core_window *cw) /* This will also free the session data: */ sslcert_viewer_fini(cvwin->ssl_session_data); - LOG("cw %p", cw); + NSLOG(netsurf, INFO, "cw %p", cw); } static void atari_sslcert_viewer_draw(struct core_window *cw, int x, @@ -123,7 +123,7 @@ static void atari_sslcert_viewer_keypress(struct core_window *cw, uint32_t ucs4) cvwin = (struct atari_sslcert_viewer_s *)atari_treeview_get_user_data(cw); - LOG("ucs4: %"PRIu32, ucs4); + NSLOG(netsurf, INFO, "ucs4: %"PRIu32, ucs4); sslcert_viewer_keypress(cvwin->ssl_session_data, ucs4); } @@ -150,14 +150,14 @@ static short handle_event(GUIWIN *win, EVMULT_OUT *ev_out, short msg[8]) short retval = 0; OBJECT *toolbar; - LOG("win %p", win); + NSLOG(netsurf, INFO, "win %p", win); if(ev_out->emo_events & MU_MESAG){ switch (msg[0]) { case WM_TOOLBAR: toolbar = gemtk_obj_get_tree(TOOLBAR_SSL_CERT); - LOG("CERTVIEWER WM_TOOLBAR"); + NSLOG(netsurf, INFO, "CERTVIEWER WM_TOOLBAR"); tv = (struct core_window*) gemtk_wm_get_user_data(win); assert(tv); cvwin = (struct atari_sslcert_viewer_s *) @@ -238,7 +238,7 @@ static void atari_sslcert_viewer_init(struct atari_sslcert_viewer_s * cvwin, if (cvwin->tv == NULL) { /* handle it properly, clean up previous allocs */ - LOG("Failed to allocate treeview"); + NSLOG(netsurf, INFO, "Failed to allocate treeview"); return; } @@ -280,7 +280,7 @@ static void atari_sslcert_viewer_destroy(struct atari_sslcert_viewer_s * cvwin) assert(cvwin->init); assert(cvwin->window); - LOG("cvwin %p", cvwin); + NSLOG(netsurf, INFO, "cvwin %p", cvwin); if (atari_treeview_is_open(cvwin->tv)) atari_treeview_close(cvwin->tv); @@ -289,5 +289,5 @@ static void atari_sslcert_viewer_destroy(struct atari_sslcert_viewer_s * cvwin) cvwin->window = NULL; atari_treeview_delete(cvwin->tv); free(cvwin); - LOG("done"); + NSLOG(netsurf, INFO, "done"); } diff --git a/frontends/atari/cookies.c b/frontends/atari/cookies.c index 9045009fc..df2de0d4c 100644 --- a/frontends/atari/cookies.c +++ b/frontends/atari/cookies.c @@ -63,7 +63,7 @@ static nserror atari_cookie_manager_init_phase2(struct core_window *cw, struct core_window_callback_table *cb_t) { - LOG("cw %p",cw); + NSLOG(netsurf, INFO, "cw %p", cw); return(cookie_manager_init(cb_t, cw)); } @@ -71,7 +71,7 @@ atari_cookie_manager_init_phase2(struct core_window *cw, static void atari_cookie_manager_finish(struct core_window *cw) { - LOG("cw %p",cw); + NSLOG(netsurf, INFO, "cw %p", cw); cookie_manager_fini(); } @@ -89,7 +89,7 @@ atari_cookie_manager_draw(struct core_window *cw, static void atari_cookie_manager_keypress(struct core_window *cw, uint32_t ucs4) { - LOG("ucs4: %"PRIu32, ucs4); + NSLOG(netsurf, INFO, "ucs4: %"PRIu32, ucs4); cookie_manager_keypress(ucs4); } @@ -108,13 +108,13 @@ static short handle_event(GUIWIN *win, EVMULT_OUT *ev_out, short msg[8]) { short retval = 0; - LOG("win %p", win); + NSLOG(netsurf, INFO, "win %p", win); if (ev_out->emo_events & MU_MESAG) { switch (msg[0]) { case WM_TOOLBAR: - LOG("WM_TOOLBAR"); + NSLOG(netsurf, INFO, "WM_TOOLBAR"); break; case WM_CLOSED: @@ -158,7 +158,8 @@ void atari_cookie_manager_init(void) if (atari_cookie_manager.tv == NULL) { /* handle it properly, clean up previous allocs */ - LOG("Failed to allocate treeview"); + NSLOG(netsurf, INFO, + "Failed to allocate treeview"); return; } @@ -209,7 +210,7 @@ void atari_cookie_manager_destroy(void) atari_treeview_delete(atari_cookie_manager.tv); atari_cookie_manager.init = false; } - LOG("done"); + NSLOG(netsurf, INFO, "done"); } diff --git a/frontends/atari/ctxmenu.c b/frontends/atari/ctxmenu.c index e25d8e522..ef4f01ae2 100644 --- a/frontends/atari/ctxmenu.c +++ b/frontends/atari/ctxmenu.c @@ -288,7 +288,9 @@ void context_popup(struct gui_window * gw, short x, short y) /* the GEMDOS cmdline contains the length of the commandline in the first byte: */ cmdline[0] = (unsigned char)strlen(tempfile); - LOG("Creating temporay source file: %s\n", tempfile); + NSLOG(netsurf, INFO, + "Creating temporay source file: %s\n", + tempfile); fp_tmpfile = fopen(tempfile, "w"); if (fp_tmpfile != NULL){ fwrite(data, size, 1, fp_tmpfile); @@ -306,7 +308,8 @@ void context_popup(struct gui_window * gw, short x, short y) } } else { - LOG("Invalid content!"); + NSLOG(netsurf, INFO, + "Invalid content!"); } } else { form_alert(0, "[1][Set option \"atari_editor\".][OK]"); diff --git a/frontends/atari/deskmenu.c b/frontends/atari/deskmenu.c index addba2764..32dfd7084 100644 --- a/frontends/atari/deskmenu.c +++ b/frontends/atari/deskmenu.c @@ -208,7 +208,7 @@ static void __CDECL menu_new_win(short item, short title, void *data) nserror error; const char *addr; - LOG("%s", __FUNCTION__); + NSLOG(netsurf, INFO, "%s", __FUNCTION__); if (nsoption_charp(homepage_url) != NULL) { addr = nsoption_charp(homepage_url); @@ -236,7 +236,7 @@ static void __CDECL menu_open_url(short item, short title, void *data) { struct gui_window * gw; struct browser_window * bw ; - LOG("%s", __FUNCTION__); + NSLOG(netsurf, INFO, "%s", __FUNCTION__); gw = input_window; if( gw == NULL ) { @@ -251,7 +251,7 @@ static void __CDECL menu_open_url(short item, short title, void *data) static void __CDECL menu_open_file(short item, short title, void *data) { - LOG("%s", __FUNCTION__); + NSLOG(netsurf, INFO, "%s", __FUNCTION__); const char * filename = file_select(messages_get("OpenFile"), ""); if( filename != NULL ){ @@ -280,7 +280,7 @@ static void __CDECL menu_open_file(short item, short title, void *data) static void __CDECL menu_close_win(short item, short title, void *data) { - LOG("%s", __FUNCTION__); + NSLOG(netsurf, INFO, "%s", __FUNCTION__); if( input_window == NULL ) return; gui_window_destroy( input_window ); @@ -288,7 +288,7 @@ static void __CDECL menu_close_win(short item, short title, void *data) static void __CDECL menu_save_page(short item, short title, void *data) { - LOG("%s", __FUNCTION__); + NSLOG(netsurf, INFO, "%s", __FUNCTION__); static bool init = true; bool is_folder=false; const char * path; @@ -319,7 +319,7 @@ static void __CDECL menu_quit(short item, short title, void *data) { short buff[8]; memset( &buff, 0, sizeof(short)*8 ); - LOG("%s", __FUNCTION__); + NSLOG(netsurf, INFO, "%s", __FUNCTION__); gemtk_wm_send_msg(NULL, AP_TERM, 0, 0, 0, 0); } @@ -331,21 +331,21 @@ static void __CDECL menu_cut(short item, short title, void *data) static void __CDECL menu_copy(short item, short title, void *data) { - LOG("%s", __FUNCTION__); + NSLOG(netsurf, INFO, "%s", __FUNCTION__); if( input_window != NULL ) browser_window_key_press( input_window->browser->bw, NS_KEY_COPY_SELECTION); } static void __CDECL menu_paste(short item, short title, void *data) { - LOG("%s", __FUNCTION__); + NSLOG(netsurf, INFO, "%s", __FUNCTION__); if( input_window != NULL ) browser_window_key_press( input_window->browser->bw, NS_KEY_PASTE); } static void __CDECL menu_find(short item, short title, void *data) { - LOG("%s", __FUNCTION__); + NSLOG(netsurf, INFO, "%s", __FUNCTION__); if (input_window != NULL) { if (input_window->search) { window_close_search(input_window->root); @@ -358,13 +358,13 @@ static void __CDECL menu_find(short item, short title, void *data) static void __CDECL menu_choices(short item, short title, void *data) { - LOG("%s", __FUNCTION__); + NSLOG(netsurf, INFO, "%s", __FUNCTION__); open_settings(); } static void __CDECL menu_stop(short item, short title, void *data) { - LOG("%s", __FUNCTION__); + NSLOG(netsurf, INFO, "%s", __FUNCTION__); if( input_window == NULL ) return; @@ -378,7 +378,7 @@ static void __CDECL menu_reload(short item, short title, void *data) if(input_window == NULL) return; toolbar_reload_click(input_window->root->toolbar); - LOG("%s", __FUNCTION__); + NSLOG(netsurf, INFO, "%s", __FUNCTION__); } @@ -408,7 +408,7 @@ static void __CDECL menu_dec_scale(short item, short title, void *data) static void __CDECL menu_toolbars(short item, short title, void *data) { static int state = 0; - LOG("%s", __FUNCTION__); + NSLOG(netsurf, INFO, "%s", __FUNCTION__); if( input_window != null && input_window->root->toolbar != null ){ state = !state; // TODO: implement toolbar hide @@ -418,7 +418,7 @@ static void __CDECL menu_toolbars(short item, short title, void *data) static void __CDECL menu_savewin(short item, short title, void *data) { - LOG("%s", __FUNCTION__); + NSLOG(netsurf, INFO, "%s", __FUNCTION__); if (input_window && input_window->browser) { GRECT rect; wind_get_grect(gemtk_wm_get_handle(input_window->root->win), WF_CURRXYWH, @@ -438,7 +438,7 @@ static void __CDECL menu_savewin(short item, short title, void *data) static void __CDECL menu_debug_render(short item, short title, void *data) { - LOG("%s", __FUNCTION__); + NSLOG(netsurf, INFO, "%s", __FUNCTION__); html_redraw_debug = !html_redraw_debug; if( input_window != NULL ) { if ( input_window->browser != NULL @@ -469,7 +469,7 @@ static void __CDECL menu_bg_images(short item, short title, void *data) static void __CDECL menu_back(short item, short title, void *data) { - LOG("%s", __FUNCTION__); + NSLOG(netsurf, INFO, "%s", __FUNCTION__); if( input_window == NULL ) return; toolbar_back_click(input_window->root->toolbar); @@ -477,7 +477,7 @@ static void __CDECL menu_back(short item, short title, void *data) static void __CDECL menu_forward(short item, short title, void *data) { - LOG("%s", __FUNCTION__); + NSLOG(netsurf, INFO, "%s", __FUNCTION__); if( input_window == NULL ) return; toolbar_forward_click(input_window->root->toolbar); @@ -485,7 +485,7 @@ static void __CDECL menu_forward(short item, short title, void *data) static void __CDECL menu_home(short item, short title, void *data) { - LOG("%s", __FUNCTION__); + NSLOG(netsurf, INFO, "%s", __FUNCTION__); if( input_window == NULL ) return; toolbar_home_click(input_window->root->toolbar); @@ -493,20 +493,20 @@ static void __CDECL menu_home(short item, short title, void *data) static void __CDECL menu_lhistory(short item, short title, void *data) { - LOG("%s", __FUNCTION__); + NSLOG(netsurf, INFO, "%s", __FUNCTION__); if( input_window == NULL ) return; } static void __CDECL menu_ghistory(short item, short title, void *data) { - LOG("%s", __FUNCTION__); + NSLOG(netsurf, INFO, "%s", __FUNCTION__); atari_global_history_open(); } static void __CDECL menu_add_bookmark(short item, short title, void *data) { - LOG("%s", __FUNCTION__); + NSLOG(netsurf, INFO, "%s", __FUNCTION__); if (input_window) { if( browser_window_has_content(input_window->browser->bw) ){ atari_hotlist_add_page( @@ -519,26 +519,26 @@ static void __CDECL menu_add_bookmark(short item, short title, void *data) static void __CDECL menu_bookmarks(short item, short title, void *data) { - LOG("%s", __FUNCTION__); + NSLOG(netsurf, INFO, "%s", __FUNCTION__); atari_hotlist_open(); } static void __CDECL menu_cookies(short item, short title, void *data) { - LOG("%s", __FUNCTION__); + NSLOG(netsurf, INFO, "%s", __FUNCTION__); atari_cookie_manager_open(); } static void __CDECL menu_vlog(short item, short title, void *data) { - LOG("%s", __FUNCTION__); + NSLOG(netsurf, INFO, "%s", __FUNCTION__); verbose_log = !verbose_log; menu_icheck(h_gem_menu, MAINMENU_M_VLOG, (verbose_log) ? 1 : 0); } static void __CDECL menu_help_content(short item, short title, void *data) { - LOG("%s", __FUNCTION__); + NSLOG(netsurf, INFO, "%s", __FUNCTION__); } /* @@ -580,14 +580,16 @@ static void register_menu_str( struct s_menu_item_evnt * mi ) while (i > 2) { if ((strncmp(" ", &str[i], 2) == 0) && (strlen(&str[i]) > 2)) { // "Standard" Keyboard Shortcut Element found: - LOG("Standard Keyboard Shortcut: \"%s\"\n", &str[i]); + NSLOG(netsurf, INFO, + "Standard Keyboard Shortcut: \"%s\"\n", &str[i]); x = i+2; is_std_shortcut = true; break; } if( str[i] == '['){ - LOG("Keyboard Shortcut: \"%s\"\n", &str[i]); + NSLOG(netsurf, INFO, "Keyboard Shortcut: \"%s\"\n", + &str[i]); // "Custom" Keyboard Shortcut Element found (identified by [): x = i; break; @@ -662,8 +664,12 @@ static void register_menu_str( struct s_menu_item_evnt * mi ) } } - LOG("Registered keyboard shortcut for \"%s\" => mod: %d, ""keycode: %ld, ascii: %c\n", - str, accel->mod, accel->keycode, accel->ascii); + NSLOG(netsurf, INFO, + "Registered keyboard shortcut for \"%s\" => mod: %d, ""keycode: %ld, ascii: %c\n", + str, + accel->mod, + accel->keycode, + accel->ascii); } } diff --git a/frontends/atari/download.c b/frontends/atari/download.c index d756e6694..7a1c7d2b7 100644 --- a/frontends/atari/download.c +++ b/frontends/atari/download.c @@ -194,7 +194,7 @@ static void on_close(struct gui_download_window * dw) static void gui_download_window_destroy( struct gui_download_window * gdw) { - LOG("gdw %p", gdw); + NSLOG(netsurf, INFO, "gdw %p", gdw); if (gdw->status == NSATARI_DOWNLOAD_WORKING) { download_context_abort(gdw->ctx); @@ -253,7 +253,8 @@ gui_download_window_create(download_context *ctx, struct gui_window *parent) char alert[200]; - LOG("Creating download window for gui window: %p", parent); + NSLOG(netsurf, INFO, "Creating download window for gui window: %p", + parent); /* TODO: Implement real form and use messages file strings! */ @@ -330,7 +331,8 @@ gui_download_window_create(download_context *ctx, struct gui_window *parent) gemtk_wm_set_toolbar_redraw_func(gdw->guiwin, toolbar_redraw_cb); strncpy((char*)&gdw->lbl_file, filename, MAX_SLEN_LBL_FILE-1); - LOG("created download: %s (total size: %d)", gdw->destination, gdw->size_total); + NSLOG(netsurf, INFO, "created download: %s (total size: %d)", + gdw->destination, gdw->size_total); GRECT work, curr; work.g_x = 0; @@ -357,7 +359,7 @@ static nserror gui_download_window_data(struct gui_download_window *dw, uint32_t tnow = clck / (CLOCKS_PER_SEC>>3); uint32_t sdiff = (clck / (CLOCKS_PER_SEC)) - dw->start; - LOG("dw %p",dw); + NSLOG(netsurf, INFO, "dw %p", dw); if (dw->abort == true){ dw->status = NSATARI_DOWNLOAD_CANCELED; @@ -405,7 +407,7 @@ static nserror gui_download_window_data(struct gui_download_window *dw, static void gui_download_window_error(struct gui_download_window *dw, const char *error_msg) { - LOG("%s", error_msg); + NSLOG(netsurf, INFO, "%s", error_msg); strncpy((char*)&dw->lbl_file, error_msg, MAX_SLEN_LBL_FILE-1); dw->status = NSATARI_DOWNLOAD_ERROR; @@ -416,7 +418,7 @@ static void gui_download_window_error(struct gui_download_window *dw, static void gui_download_window_done(struct gui_download_window *dw) { - LOG("dw %p", dw); + NSLOG(netsurf, INFO, "dw %p", dw); // TODO: change abort to close dw->status = NSATARI_DOWNLOAD_COMPLETE; diff --git a/frontends/atari/filetype.c b/frontends/atari/filetype.c index d27076e9c..706347137 100644 --- a/frontends/atari/filetype.c +++ b/frontends/atari/filetype.c @@ -36,7 +36,7 @@ const char *fetch_filetype(const char *unix_path) char * res = (char*)"text/html"; l = strlen(unix_path); - LOG("unix path: %s", unix_path); + NSLOG(netsurf, INFO, "unix path: %s", unix_path); /* This line is added for devlopment versions running from the root dir: */ if( strchr( unix_path, (int)'.' ) ){ @@ -85,6 +85,6 @@ const char *fetch_filetype(const char *unix_path) } } - LOG("mime type: %s", res); + NSLOG(netsurf, INFO, "mime type: %s", res); return( res ); } diff --git a/frontends/atari/findfile.c b/frontends/atari/findfile.c index 45ca6d916..8784727bc 100644 --- a/frontends/atari/findfile.c +++ b/frontends/atari/findfile.c @@ -31,7 +31,7 @@ char * local_file_to_url( const char * filename ) #define BACKSLASH 0x5C char * url; - LOG("in: %s", filename); + NSLOG(netsurf, INFO, "in: %s", filename); if( strlen(filename) <= 2){ return( NULL ); @@ -55,7 +55,7 @@ char * local_file_to_url( const char * filename ) free(fname_local); - LOG("out: %s", url); + NSLOG(netsurf, INFO, "out: %s", url); return( url ); #undef BACKSLASH @@ -81,10 +81,10 @@ char * atari_find_resource(char *buf, const char *filename, const char *def) { char *cdir = NULL; char t[PATH_MAX]; - LOG("%s (def: %s)", filename, def); + NSLOG(netsurf, INFO, "%s (def: %s)", filename, def); strcpy(t, NETSURF_GEM_RESPATH); strcat(t, filename); - LOG("checking %s", (char *)&t); + NSLOG(netsurf, INFO, "checking %s", (char *)&t); if (gemdos_realpath(t, buf) != NULL) { if (access(buf, R_OK) == 0) { return buf; @@ -92,7 +92,7 @@ char * atari_find_resource(char *buf, const char *filename, const char *def) } strcpy(t, "./"); strcat(t, filename); - LOG("checking %s", (char *)&t); + NSLOG(netsurf, INFO, "checking %s", (char *)&t); if (gemdos_realpath(t, buf) != NULL) { if (access(buf, R_OK) == 0) { return buf; @@ -104,7 +104,7 @@ char * atari_find_resource(char *buf, const char *filename, const char *def) strcpy(t, cdir); strcat(t, "/.netsurf/"); strcat(t, filename); - LOG("checking %s", (char *)&t); + NSLOG(netsurf, INFO, "checking %s", (char *)&t); if (gemdos_realpath(t, buf) != NULL) { if (access(buf, R_OK) == 0) return buf; @@ -116,19 +116,19 @@ char * atari_find_resource(char *buf, const char *filename, const char *def) if (gemdos_realpath(cdir, buf) != NULL) { strcat(buf, "/"); strcat(buf, filename); - LOG("checking %s", (char *)&t); + NSLOG(netsurf, INFO, "checking %s", (char *)&t); if (access(buf, R_OK) == 0) return buf; } } if (def[0] == '~') { snprintf(t, PATH_MAX, "%s%s", getenv("HOME"), def + 1); - LOG("checking %s", (char *)&t); + NSLOG(netsurf, INFO, "checking %s", (char *)&t); if (gemdos_realpath(t, buf) == NULL) { strcpy(buf, t); } } else { - LOG("checking %s", (char *)def); + NSLOG(netsurf, INFO, "checking %s", (char *)def); if (gemdos_realpath(def, buf) == NULL) { strcpy(buf, def); } diff --git a/frontends/atari/gui.c b/frontends/atari/gui.c index 4876d3106..a400285d3 100644 --- a/frontends/atari/gui.c +++ b/frontends/atari/gui.c @@ -139,11 +139,11 @@ static void atari_poll(void) evnt_multi_fast(&aes_event_in, aes_msg_out, &aes_event_out); if(gemtk_wm_dispatch_event(&aes_event_in, &aes_event_out, aes_msg_out) == 0) { if( (aes_event_out.emo_events & MU_MESAG) != 0 ) { - LOG("WM: %d\n", aes_msg_out[0]); + NSLOG(netsurf, INFO, "WM: %d\n", aes_msg_out[0]); switch(aes_msg_out[0]) { case MN_SELECTED: - LOG("Menu Item: %d\n", aes_msg_out[4]); + NSLOG(netsurf, INFO, "Menu Item: %d\n", aes_msg_out[4]); deskmenu_dispatch_item(aes_msg_out[3], aes_msg_out[4]); break; @@ -195,13 +195,14 @@ gui_window_create(struct browser_window *bw, gui_window_create_flags flags) { struct gui_window *gw=NULL; - LOG("gw: %p, BW: %p, existing %p, flags: %d\n", gw, bw, existing, (int)flags); + NSLOG(netsurf, INFO, "gw: %p, BW: %p, existing %p, flags: %d\n", gw, bw, + existing, (int)flags); gw = calloc(1, sizeof(struct gui_window)); if (gw == NULL) return NULL; - LOG("new window: %p, bw: %p\n", gw, bw); + NSLOG(netsurf, INFO, "new window: %p, bw: %p\n", gw, bw); window_create(gw, bw, existing, WIDGET_STATUSBAR|WIDGET_TOOLBAR|WIDGET_RESIZE\ |WIDGET_SCROLL); if (gw->root->win) { @@ -253,7 +254,7 @@ void gui_window_destroy(struct gui_window *gw) if (gw == NULL) return; - LOG("%s\n", __FUNCTION__); + NSLOG(netsurf, INFO, "%s\n", __FUNCTION__); if (input_window == gw) { gui_set_input_gui_window(NULL); @@ -444,7 +445,8 @@ gui_window_set_scroll(struct gui_window *gw, const struct rect *rect) return NSERROR_BAD_PARAMETER; } - LOG("scroll (gui_window: %p) %d, %d\n", gw, rect->x0, rect->y0); + NSLOG(netsurf, INFO, "scroll (gui_window: %p) %d, %d\n", gw, rect->x0, + rect->y0); window_scroll_by(gw->root, rect->x0, rect->y0); return NSERROR_OK; @@ -771,7 +773,8 @@ static void gui_401login_open(nsurl *url, const char *realm, char * out = NULL; bres = login_form_do( url, (char*)realm, &out); if (bres) { - LOG("url: %s, realm: %s, auth: %s\n", nsurl_access(url), realm, out); + NSLOG(netsurf, INFO, "url: %s, realm: %s, auth: %s\n", + nsurl_access(url), realm, out); urldb_set_auth_details(url, realm, out); } if (out != NULL) { @@ -789,7 +792,7 @@ gui_cert_verify(nsurl *url, const struct ssl_cert_info *certs, void *cbpw) { struct sslcert_session_data *data; - LOG("url %s", nsurl_access(url)); + NSLOG(netsurf, INFO, "url %s", nsurl_access(url)); // TODO: localize string int b = form_alert(1, "[2][SSL Verify failed, continue?][Continue|Abort|Details...]"); @@ -812,7 +815,8 @@ gui_cert_verify(nsurl *url, const struct ssl_cert_info *certs, void gui_set_input_gui_window(struct gui_window *gw) { - LOG("Setting input window from: %p to %p\n", input_window, gw); + NSLOG(netsurf, INFO, "Setting input window from: %p to %p\n", + input_window, gw); input_window = gw; } @@ -823,7 +827,7 @@ struct gui_window * gui_get_input_window(void) static void gui_quit(void) { - LOG("quitting"); + NSLOG(netsurf, INFO, "quitting"); struct gui_window *gw = window_list; struct gui_window *tmp = window_list; @@ -852,9 +856,9 @@ static void gui_quit(void) rsrc_free(); - LOG("Shutting down plotter"); + NSLOG(netsurf, INFO, "Shutting down plotter"); plot_finalise(); - LOG("done"); + NSLOG(netsurf, INFO, "done"); } /** @@ -866,7 +870,7 @@ process_cmdline(int argc, char** argv) int opt; bool set_default_dimensions = true; - LOG("argc %d, argv %p", argc, argv); + NSLOG(netsurf, INFO, "argc %d, argv %p", argc, argv); if ((nsoption_int(window_width) != 0) && (nsoption_int(window_height) != 0)) { @@ -959,7 +963,7 @@ static nserror set_defaults(struct nsoption_s *defaults) /* Set defaults for absent option strings */ nsoption_setnull_charp(cookie_file, strdup("cookies")); if (nsoption_charp(cookie_file) == NULL) { - LOG("Failed initialising string options"); + NSLOG(netsurf, INFO, "Failed initialising string options"); return NSERROR_BAD_PARAMETER; } return NSERROR_OK; @@ -976,7 +980,7 @@ static void gui_init(int argc, char** argv) OBJECT * cursors; atari_find_resource(buf, "netsurf.rsc", "./res/netsurf.rsc"); - LOG("Using RSC file: %s ", (char *)&buf); + NSLOG(netsurf, INFO, "Using RSC file: %s ", (char *)&buf); if (rsrc_load(buf)==0) { char msg[1024]; @@ -1012,15 +1016,16 @@ static void gui_init(int argc, char** argv) create_cursor(MFORM_EX_FLAG_USERFORM, CURSOR_HELP, cursors, &gem_cursors.help); - LOG("Enabling core select menu"); + NSLOG(netsurf, INFO, "Enabling core select menu"); nsoption_set_bool(core_select_menu, true); - LOG("Loading url.db from: %s", nsoption_charp(url_file)); + NSLOG(netsurf, INFO, "Loading url.db from: %s", nsoption_charp(url_file)); if( strlen(nsoption_charp(url_file)) ) { urldb_load(nsoption_charp(url_file)); } - LOG("Loading cookies from: %s", nsoption_charp(cookie_file)); + NSLOG(netsurf, INFO, "Loading cookies from: %s", + nsoption_charp(cookie_file)); if( strlen(nsoption_charp(cookie_file)) ) { urldb_load_cookies(nsoption_charp(cookie_file)); } @@ -1028,10 +1033,10 @@ static void gui_init(int argc, char** argv) if (process_cmdline(argc,argv) != true) die("unable to process command line.\n"); - LOG("Initializing NKC..."); + NSLOG(netsurf, INFO, "Initializing NKC..."); nkc_init(); - LOG("Initializing plotters..."); + NSLOG(netsurf, INFO, "Initializing plotters..."); struct redraw_context ctx = { .interactive = true, .background_images = true, @@ -1172,18 +1177,18 @@ int main(int argc, char** argv) ret = messages_add_from_file(messages); /* common initialisation */ - LOG("Initialising core..."); + NSLOG(netsurf, INFO, "Initialising core..."); ret = netsurf_init(store); if (ret != NSERROR_OK) { die("NetSurf failed to initialise"); } - LOG("Initializing GUI..."); + NSLOG(netsurf, INFO, "Initializing GUI..."); gui_init(argc, argv); graf_mouse( ARROW , NULL); - LOG("Creating initial browser window..."); + NSLOG(netsurf, INFO, "Creating initial browser window..."); addr = option_homepage_url; if (strncmp(addr, "file://", 7) && strncmp(addr, "http://", 7)) { if (stat(addr, &stat_buf) == 0) { @@ -1205,7 +1210,7 @@ int main(int argc, char** argv) if (ret != NSERROR_OK) { atari_warn_user(messages_get_errorcode(ret), 0); } else { - LOG("Entering Atari event mainloop..."); + NSLOG(netsurf, INFO, "Entering Atari event mainloop..."); while (!atari_quit) { atari_poll(); } @@ -1219,7 +1224,7 @@ int main(int argc, char** argv) fclose(stdout); fclose(stderr); #endif - LOG("exit_gem"); + NSLOG(netsurf, INFO, "exit_gem"); exit_gem(); return 0; diff --git a/frontends/atari/history.c b/frontends/atari/history.c index 56aafd056..ec602684f 100644 --- a/frontends/atari/history.c +++ b/frontends/atari/history.c @@ -39,13 +39,13 @@ static nserror atari_global_history_init_phase2(struct core_window *cw, struct core_window_callback_table *cb_t) { - LOG("cw %p", cw); + NSLOG(netsurf, INFO, "cw %p", cw); return(global_history_init(cb_t, cw)); } static void atari_global_history_finish(struct core_window *cw) { - LOG("cw %p", cw); + NSLOG(netsurf, INFO, "cw %p", cw); global_history_fini(); } @@ -58,7 +58,7 @@ static void atari_global_history_draw(struct core_window *cw, int x, static void atari_global_history_keypress(struct core_window *cw, uint32_t ucs4) { - LOG("ucs4: %"PRIu32, ucs4); + NSLOG(netsurf, INFO, "ucs4: %"PRIu32, ucs4); global_history_keypress(ucs4); } @@ -67,7 +67,7 @@ atari_global_history_mouse_action(struct core_window *cw, browser_mouse_state mouse, int x, int y) { - LOG("x: %d, y: %d\n", x, y); + NSLOG(netsurf, INFO, "x: %d, y: %d\n", x, y); global_history_mouse_action(mouse, x, y); } @@ -82,7 +82,7 @@ static short handle_event(GUIWIN *win, EVMULT_OUT *ev_out, short msg[8]) { short retval = 0; - LOG("win %p", win); + NSLOG(netsurf, INFO, "win %p", win); if (ev_out->emo_events & MU_MESAG) { switch (msg[0]) { @@ -134,7 +134,8 @@ void atari_global_history_init(void) if (atari_global_history.tv == NULL) { /* handle it properly, clean up previous allocs */ - LOG("Failed to allocate treeview"); + NSLOG(netsurf, INFO, + "Failed to allocate treeview"); return; } } @@ -181,7 +182,7 @@ void atari_global_history_destroy(void) atari_treeview_delete(atari_global_history.tv); atari_global_history.init = false; } - LOG("done"); + NSLOG(netsurf, INFO, "done"); } void atari_global_history_redraw(void) diff --git a/frontends/atari/hotlist.c b/frontends/atari/hotlist.c index 659b3a562..3a54c98eb 100644 --- a/frontends/atari/hotlist.c +++ b/frontends/atari/hotlist.c @@ -72,13 +72,13 @@ static struct atari_treeview_callbacks atari_hotlist_treeview_callbacks = { static nserror atari_hotlist_init_phase2(struct core_window *cw, struct core_window_callback_table *cb_t) { - LOG("cw:%p", cw); + NSLOG(netsurf, INFO, "cw:%p", cw); return hotlist_manager_init(cb_t, cw); } static void atari_hotlist_finish(struct core_window *cw) { - LOG("cw:%p", cw); + NSLOG(netsurf, INFO, "cw:%p", cw); hotlist_fini(); } @@ -93,7 +93,7 @@ static void atari_hotlist_keypress(struct core_window *cw, uint32_t ucs4) { //GUIWIN *gemtk_win; //GRECT area; - LOG("ucs4: %"PRIu32 , ucs4); + NSLOG(netsurf, INFO, "ucs4: %"PRIu32, ucs4); hotlist_keypress(ucs4); //gemtk_win = atari_treeview_get_gemtk_window(cw); //atari_treeview_get_grect(cw, TREEVIEW_AREA_CONTENT, &area); @@ -104,7 +104,7 @@ static void atari_hotlist_mouse_action(struct core_window *cw, browser_mouse_state mouse, int x, int y) { - LOG("x: %d, y: %d\n", x, y); + NSLOG(netsurf, INFO, "x: %d, y: %d\n", x, y); hotlist_mouse_action(mouse, x, y); } @@ -123,7 +123,7 @@ static short handle_event(GUIWIN *win, EVMULT_OUT *ev_out, short msg[8]) GRECT tb_area; GUIWIN * gemtk_win; - LOG("gw:%p", win); + NSLOG(netsurf, INFO, "gw:%p", win); tv = (struct atari_treeview_window*) gemtk_wm_get_user_data(win); cw = (struct core_window *)tv; @@ -132,7 +132,7 @@ static short handle_event(GUIWIN *win, EVMULT_OUT *ev_out, short msg[8]) switch (msg[0]) { case WM_TOOLBAR: - LOG("WM_TOOLBAR"); + NSLOG(netsurf, INFO, "WM_TOOLBAR"); toolbar = gemtk_obj_get_tree(TOOLBAR_HOTLIST); @@ -198,7 +198,7 @@ void atari_hotlist_init(void) strncpy( (char*)&hl.path, nsoption_charp(hotlist_file), PATH_MAX-1 ); } - LOG("Hotlist: %s", (char *)&hl.path); + NSLOG(netsurf, INFO, "Hotlist: %s", (char *)&hl.path); hotlist_init(hl.path, hl.path); if( hl.window == NULL ){ @@ -224,7 +224,8 @@ void atari_hotlist_init(void) if (hl.tv == NULL) { /* handle it properly, clean up previous allocs */ - LOG("Failed to allocate treeview"); + NSLOG(netsurf, INFO, + "Failed to allocate treeview"); return; } @@ -276,7 +277,7 @@ void atari_hotlist_destroy(void) atari_treeview_delete(hl.tv); hl.init = false; } - LOG("done"); + NSLOG(netsurf, INFO, "done"); } void atari_hotlist_redraw(void) @@ -299,7 +300,7 @@ void atari_hotlist_add_page( const char * url, const char * title ) return; if (hotlist_has_url(nsurl)) { - LOG("URL already added as Bookmark"); + NSLOG(netsurf, INFO, "URL already added as Bookmark"); nsurl_unref(nsurl); return; } diff --git a/frontends/atari/osspec.c b/frontends/atari/osspec.c index f64402e8d..ca042f164 100644 --- a/frontends/atari/osspec.c +++ b/frontends/atari/osspec.c @@ -119,14 +119,14 @@ char *gemdos_realpath(const char * path, char * rpath) return(rpath); } - LOG("realpath in: %s\n", path); + NSLOG(netsurf, INFO, "realpath in: %s\n", path); r = realpath(path, work); if (r != NULL) { unx2dos((const char *)r, rpath); - LOG("realpath out: %s\n", rpath); + NSLOG(netsurf, INFO, "realpath out: %s\n", rpath); return(rpath); } else { - LOG("realpath out: NULL!\n"); + NSLOG(netsurf, INFO, "realpath out: NULL!\n"); } return (NULL); } diff --git a/frontends/atari/plot/font_freetype.c b/frontends/atari/plot/font_freetype.c index 17d3c3bfd..1688e978b 100644 --- a/frontends/atari/plot/font_freetype.c +++ b/frontends/atari/plot/font_freetype.c @@ -154,11 +154,12 @@ static FT_Error ft_face_requester(FTC_FaceID face_id, FT_Library library, FT_Po error = FT_New_Face(library, ft_face->fontfile, ft_face->index, face); if (error) { - LOG("Could not find font (code %d)\n", error); + NSLOG(netsurf, INFO, "Could not find font (code %d)\n", error); } else { error = FT_Select_Charmap(*face, FT_ENCODING_UNICODE); if (error) { - LOG("Could not select charmap (code %d)\n", error); + NSLOG(netsurf, INFO, + "Could not select charmap (code %d)\n", error); } else { for (cidx = 0; cidx < (*face)->num_charmaps; cidx++) { if ((*face)->charmap == (*face)->charmaps[cidx]) { @@ -168,7 +169,7 @@ static FT_Error ft_face_requester(FTC_FaceID face_id, FT_Library library, FT_Po } } } - LOG("Loaded face from %s\n", ft_face->fontfile); + NSLOG(netsurf, INFO, "Loaded face from %s\n", ft_face->fontfile); return error; } @@ -190,7 +191,9 @@ ft_new_face(const char *option, const char *resname, const char *fontfile) } error = FTC_Manager_LookupFace(ft_cmanager, (FTC_FaceID)newf, &aface); if (error) { - LOG("Could not find font face %s (code %d)\n", fontfile, error); + NSLOG(netsurf, INFO, + "Could not find font face %s (code %d)\n", fontfile, + error); free(newf); newf = font_faces[FONT_FACE_DEFAULT]; /* use default */ } @@ -292,7 +295,8 @@ static bool ft_font_init(void) /* freetype library initialise */ error = FT_Init_FreeType( &library ); if (error) { - LOG("Freetype could not initialised (code %d)\n", error); + NSLOG(netsurf, INFO, + "Freetype could not initialised (code %d)\n", error); return false; } @@ -311,7 +315,9 @@ static bool ft_font_init(void) NULL, &ft_cmanager); if (error) { - LOG("Freetype could not initialise cache manager (code %d)\n", error); + NSLOG(netsurf, INFO, + "Freetype could not initialise cache manager (code %d)\n", + error); FT_Done_FreeType(library); return false; } @@ -330,7 +336,8 @@ static bool ft_font_init(void) FONT_PKG_PATH FONT_FILE_SANS ); if (font_faces[FONT_FACE_SANS_SERIF] == NULL) { - LOG("Could not find default font (code %d)\n", error); + NSLOG(netsurf, INFO, + "Could not find default font (code %d)\n", error); FTC_Manager_Done(ft_cmanager); FT_Done_FreeType(library); return false; @@ -688,7 +695,7 @@ int ctor_font_plotter_freetype( FONT_PLOTTER self ) self->draw_glyph = draw_glyph8; } - LOG("%s: %s\n", (char *)__FILE__, __FUNCTION__); + NSLOG(netsurf, INFO, "%s: %s\n", (char *)__FILE__, __FUNCTION__); if( !init ) { ft_font_init(); fontbmp = atari_bitmap_create(48, 48, 0); diff --git a/frontends/atari/plot/font_internal.c b/frontends/atari/plot/font_internal.c index 3575bc3e1..709697f74 100644 --- a/frontends/atari/plot/font_internal.c +++ b/frontends/atari/plot/font_internal.c @@ -96,7 +96,7 @@ int ctor_font_plotter_internal( FONT_PLOTTER self ) self->str_split = str_split; self->pixel_pos = pixel_pos; self->text = text; - LOG("%s: %s\n", (char *)__FILE__, __FUNCTION__); + NSLOG(netsurf, INFO, "%s: %s\n", (char *)__FILE__, __FUNCTION__); if( !init ) { vdih = self->vdi_handle; fontbmp = atari_bitmap_create(48, 48, 0); diff --git a/frontends/atari/plot/font_vdi.c b/frontends/atari/plot/font_vdi.c index ef5499207..7cd82ddc9 100644 --- a/frontends/atari/plot/font_vdi.c +++ b/frontends/atari/plot/font_vdi.c @@ -70,7 +70,7 @@ int ctor_font_plotter_vdi( FONT_PLOTTER self ) self->str_split = str_split; self->pixel_pos = pixel_pos; self->text = text; - LOG("%s: %s\n", (char *)__FILE__, __FUNCTION__); + NSLOG(netsurf, INFO, "%s: %s\n", (char *)__FILE__, __FUNCTION__); if( !init ) { vdih = self->vdi_handle; } diff --git a/frontends/atari/plot/plot.c b/frontends/atari/plot/plot.c index 2324f82d9..14c670352 100644 --- a/frontends/atari/plot/plot.c +++ b/frontends/atari/plot/plot.c @@ -1628,7 +1628,7 @@ int plot_init(const struct redraw_context *ctx, char *fdrvrname) short work_out[57]; atari_plot_vdi_handle=graf_handle(&dummy, &dummy, &dummy, &dummy); v_opnvwk(work_in, &atari_plot_vdi_handle, work_out); - LOG("Plot VDI handle: %d", atari_plot_vdi_handle); + NSLOG(netsurf, INFO, "Plot VDI handle: %d", atari_plot_vdi_handle); } read_vdi_sysinfo(atari_plot_vdi_handle, &vdi_sysinfo); if(verbose_log) { @@ -1640,7 +1640,8 @@ int plot_init(const struct redraw_context *ctx, char *fdrvrname) atari_font_flags, &err); if (err) { const char * desc = plot_err_str(err); - LOG("Unable to load font plotter %s -> %s", fdrvrname, desc ); + NSLOG(netsurf, INFO, "Unable to load font plotter %s -> %s", + fdrvrname, desc); die("font plotter"); } diff --git a/frontends/atari/rootwin.c b/frontends/atari/rootwin.c index 0b77cbba5..6576eac77 100644 --- a/frontends/atari/rootwin.c +++ b/frontends/atari/rootwin.c @@ -105,7 +105,7 @@ static short handle_event(GUIWIN *win, EVMULT_OUT *ev_out, short msg[8]) switch (msg[0]) { case WM_REDRAW: - LOG("WM_REDRAW"); + NSLOG(netsurf, INFO, "WM_REDRAW"); on_redraw(data->rootwin, msg); break; @@ -113,7 +113,7 @@ static short handle_event(GUIWIN *win, EVMULT_OUT *ev_out, short msg[8]) case WM_SIZED: case WM_MOVED: case WM_FULLED: - LOG("WM_SIZED"); + NSLOG(netsurf, INFO, "WM_SIZED"); on_resized(data->rootwin); break; @@ -132,7 +132,7 @@ static short handle_event(GUIWIN *win, EVMULT_OUT *ev_out, short msg[8]) case WM_TOPPED: case WM_NEWTOP: case WM_UNICONIFY: - LOG("WM_TOPPED"); + NSLOG(netsurf, INFO, "WM_TOPPED"); gui_set_input_gui_window(data->rootwin->active_gui_window); //window_restore_active_gui_window(data->rootwin); // TODO: use something like "restore_active_gui_window_state()" @@ -143,7 +143,8 @@ static short handle_event(GUIWIN *win, EVMULT_OUT *ev_out, short msg[8]) // TODO: this needs to iterate through all gui windows and // check if the rootwin is this window... if (data->rootwin->active_gui_window != NULL) { - LOG("WM_CLOSED initiated destroy for bw %p", data->rootwin->active_gui_window->browser->bw); + NSLOG(netsurf, INFO, "WM_CLOSED initiated destroy for bw %p", + data->rootwin->active_gui_window->browser->bw); browser_window_destroy( data->rootwin->active_gui_window->browser->bw); } @@ -166,13 +167,16 @@ static short handle_event(GUIWIN *win, EVMULT_OUT *ev_out, short msg[8]) // handle key uint16_t nkc = gem_to_norm( (short)ev_out->emo_kmeta, (short)ev_out->emo_kreturn); - LOG("rootwin MU_KEYBD input, nkc: %x\n", nkc); + NSLOG(netsurf, INFO, "rootwin MU_KEYBD input, nkc: %x\n", nkc); retval = on_window_key_input(data->rootwin, nkc); // printf("on_window_key_input: %d\n", retval); } if ((ev_out->emo_events & MU_BUTTON) != 0) { - LOG("rootwin MU_BUTTON input, x: %d, y: %d\n", ev_out->emo_mouse.p_x, ev_out->emo_mouse.p_x); + NSLOG(netsurf, INFO, + "rootwin MU_BUTTON input, x: %d, y: %d\n", + ev_out->emo_mouse.p_x, + ev_out->emo_mouse.p_x); window_get_grect(data->rootwin, BROWSER_AREA_CONTENT, &area); if (POINT_WITHIN(ev_out->emo_mouse.p_x, ev_out->emo_mouse.p_y, @@ -312,13 +316,13 @@ void window_unref_gui_window(ROOTWIN *rootwin, struct gui_window *gw) struct gui_window *w; input_window = NULL; - LOG("window: %p, gui_window: %p", rootwin, gw); + NSLOG(netsurf, INFO, "window: %p, gui_window: %p", rootwin, gw); w = window_list; // find the next active tab: while( w != NULL ) { if(w->root == rootwin && w != gw) { - LOG("activating next tab %p", w); + NSLOG(netsurf, INFO, "activating next tab %p", w); gui_set_input_gui_window(w); break; } @@ -338,7 +342,7 @@ int window_destroy(ROOTWIN *rootwin) assert(rootwin != NULL); - LOG("%p", rootwin); + NSLOG(netsurf, INFO, "%p", rootwin); if (gemtk_wm_get_user_data(rootwin->win) != NULL) { free(gemtk_wm_get_user_data(rootwin->win)); @@ -404,7 +408,7 @@ void window_restore_active_gui_window(ROOTWIN *rootwin) GRECT tb_area; struct gui_window *gw; - LOG("rootwin %p", rootwin); + NSLOG(netsurf, INFO, "rootwin %p", rootwin); assert(rootwin->active_gui_window); @@ -499,7 +503,7 @@ void window_set_focus(struct s_gui_win_root *rootwin, assert(rootwin != NULL); if (rootwin->focus.type != type || rootwin->focus.element != element) { - LOG("Set focus: %p (%d)\n", element, type); + NSLOG(netsurf, INFO, "Set focus: %p (%d)\n", element, type); rootwin->focus.type = type; rootwin->focus.element = element; switch( type ) { @@ -563,11 +567,11 @@ void window_set_active_gui_window(ROOTWIN *rootwin, struct gui_window *gw) { struct gui_window *old_gw = rootwin->active_gui_window; - LOG("gw %p",gw); + NSLOG(netsurf, INFO, "gw %p", gw); if (rootwin->active_gui_window != NULL) { if(rootwin->active_gui_window == gw) { - LOG("nothing to do..."); + NSLOG(netsurf, INFO, "nothing to do..."); return; } } @@ -576,7 +580,7 @@ void window_set_active_gui_window(ROOTWIN *rootwin, struct gui_window *gw) rootwin->active_gui_window = gw; if (old_gw != NULL) { - LOG("restoring window..."); + NSLOG(netsurf, INFO, "restoring window..."); window_restore_active_gui_window(rootwin); } } @@ -651,7 +655,7 @@ void window_open_search(ROOTWIN *rootwin, bool reformat) GRECT area; OBJECT *obj; - LOG("rootwin %p", rootwin); + NSLOG(netsurf, INFO, "rootwin %p", rootwin); gw = rootwin->active_gui_window; bw = gw->browser->bw; @@ -1478,7 +1482,13 @@ static void on_file_dropped(ROOTWIN *rootwin, short msg[8]) buff[size] = 0; - LOG("file: %s, ext: %s, size: %ld dropped at: %d,%d\n", (char *)buff, (char *)&ext, size, mx, my); + NSLOG(netsurf, INFO, + "file: %s, ext: %s, size: %ld dropped at: %d,%d\n", + (char *)buff, + (char *)&ext, + size, + mx, + my); gui_window_get_scroll(gw, &sx, &sy); @@ -1500,7 +1510,8 @@ static void on_file_dropped(ROOTWIN *rootwin, short msg[8]) if (ret != NSERROR_OK) { free(buff); /* A bad encoding should never happen */ - LOG("utf8_from_local_encoding failed"); + NSLOG(netsurf, INFO, + "utf8_from_local_encoding failed"); assert(ret != NSERROR_BAD_ENCODING); /* no memory */ goto error; diff --git a/frontends/atari/schedule.c b/frontends/atari/schedule.c index 48980426d..a8d06e499 100644 --- a/frontends/atari/schedule.c +++ b/frontends/atari/schedule.c @@ -71,7 +71,7 @@ static nserror schedule_remove(void (*callback)(void *p), void *p) return NSERROR_OK; } - LOG("removing %p, %p", callback, p); + NSLOG(netsurf, INFO, "removing %p, %p", callback, p); cur_nscb = schedule_list; prev_nscb = NULL; @@ -80,7 +80,9 @@ static nserror schedule_remove(void (*callback)(void *p), void *p) if ((cur_nscb->callback == callback) && (cur_nscb->p == p)) { /* item to remove */ - LOG("callback entry %p removing %p(%p)", cur_nscb, cur_nscb->callback, cur_nscb->p); + NSLOG(netsurf, INFO, + "callback entry %p removing %p(%p)", cur_nscb, + cur_nscb->callback, cur_nscb->p); /* remove callback */ unlnk_nscb = cur_nscb; @@ -118,7 +120,8 @@ nserror atari_schedule(int ival, void (*callback)(void *p), void *p) nscb->timeout = MS_NOW() + ival; - LOG("adding callback %p for %p(%p) at %d ms", nscb, callback, p, nscb->timeout); + NSLOG(netsurf, INFO, "adding callback %p for %p(%p) at %d ms", nscb, + callback, p, nscb->timeout); nscb->callback = callback; nscb->p = p; @@ -164,7 +167,9 @@ int schedule_run(void) prev_nscb->next = unlnk_nscb->next; } - LOG("callback entry %p running %p(%p)", unlnk_nscb, unlnk_nscb->callback, unlnk_nscb->p); + NSLOG(netsurf, INFO, + "callback entry %p running %p(%p)", unlnk_nscb, + unlnk_nscb->callback, unlnk_nscb->p); /* call callback */ unlnk_nscb->callback(unlnk_nscb->p); @@ -173,7 +178,7 @@ int schedule_run(void) /* need to deal with callback modifying the list. */ if (schedule_list == NULL) { - LOG("schedule_list == NULL"); + NSLOG(netsurf, INFO, "schedule_list == NULL"); return -1; /* no more callbacks scheduled */ } @@ -198,7 +203,8 @@ int schedule_run(void) /* make rettime relative to now and convert to ms */ nexttime = nexttime - now; - LOG("returning time to next event as %ldms", nexttime); + NSLOG(netsurf, INFO, "returning time to next event as %ldms", + nexttime); /*return next event time in milliseconds (24days max wait) */ return nexttime; @@ -210,14 +216,15 @@ void list_schedule(void) { struct nscallback *cur_nscb; - LOG("schedule list at ms clock %ld", MS_NOW()); + NSLOG(netsurf, INFO, "schedule list at ms clock %ld", MS_NOW()); cur_nscb = schedule_list; while (cur_nscb != NULL) { - LOG("Schedule %p at %ld", cur_nscb, cur_nscb->timeout); + NSLOG(netsurf, INFO, "Schedule %p at %ld", cur_nscb, + cur_nscb->timeout); cur_nscb = cur_nscb->next; } - LOG("Maxmium callbacks scheduled: %d", max_scheduled); + NSLOG(netsurf, INFO, "Maxmium callbacks scheduled: %d", max_scheduled); } diff --git a/frontends/atari/search.c b/frontends/atari/search.c index 4da7f16a3..8df4ad676 100644 --- a/frontends/atari/search.c +++ b/frontends/atari/search.c @@ -67,7 +67,7 @@ struct gui_search_table *atari_search_table = &search_table; */ void nsatari_search_set_status(bool found, void *p) { - LOG("%p set status: %d\n", p, found); + NSLOG(netsurf, INFO, "%p set status: %d\n", p, found); // TODO: maybe update GUI } @@ -80,7 +80,7 @@ void nsatari_search_set_status(bool found, void *p) void nsatari_search_set_hourglass(bool active, void *p) { SEARCH_FORM_SESSION s = (SEARCH_FORM_SESSION)p; - LOG("active: %d, session: %p", active, p); + NSLOG(netsurf, INFO, "active: %d, session: %p", active, p); if (active) { gui_window_set_pointer(s->g, GUI_POINTER_PROGRESS); } else { @@ -99,7 +99,7 @@ void nsatari_search_set_hourglass(bool active, void *p) */ void nsatari_search_add_recent(const char *string, void *p) { - LOG("%p add recent: %s\n", p, string); + NSLOG(netsurf, INFO, "%p add recent: %s\n", p, string); } @@ -115,7 +115,7 @@ void nsatari_search_set_forward_state(bool active, void *p) GRECT area; SEARCH_FORM_SESSION s = (SEARCH_FORM_SESSION)p; /* deactivate back cb */ - LOG("%p: set forward state: %d\n", p, active); + NSLOG(netsurf, INFO, "%p: set forward state: %d\n", p, active); gw = s->g; @@ -142,7 +142,7 @@ void nsatari_search_set_back_state(bool active, void *p) GRECT area; SEARCH_FORM_SESSION s = (SEARCH_FORM_SESSION)p; /* deactivate back cb */ - LOG("%p: set back state: %d\n", p, active); + NSLOG(netsurf, INFO, "%p: set back state: %d\n", p, active); s->state.back_avail = active; gw = s->g; @@ -224,7 +224,7 @@ void nsatari_search_restore_form( struct s_search_form_session *s, OBJECT *obj) void nsatari_search_session_destroy(struct s_search_form_session *s) { if (s != NULL) { - LOG("session %p", s); + NSLOG(netsurf, INFO, "session %p", s); browser_window_search_clear(s->g->browser->bw); free(s); } diff --git a/frontends/atari/settings.c b/frontends/atari/settings.c index ed1fb2e45..ac4afa315 100644 --- a/frontends/atari/settings.c +++ b/frontends/atari/settings.c @@ -172,7 +172,7 @@ static char **read_locales(void) atari_warn_user("Failed to load locales: %s",buf); return(NULL); } else { - LOG("Reading locales from: %s...", buf); + NSLOG(netsurf, INFO, "Reading locales from: %s...", buf); } /* Count items: */ @@ -980,12 +980,12 @@ void open_settings(void) void close_settings(void) { - LOG("closing"); + NSLOG(netsurf, INFO, "closing"); gemtk_wm_remove(settings_guiwin); settings_guiwin = NULL; wind_close(h_aes_win); wind_delete(h_aes_win); h_aes_win = 0; - LOG("Done"); + NSLOG(netsurf, INFO, "Done"); } diff --git a/frontends/atari/statusbar.c b/frontends/atari/statusbar.c index 3a216f9a8..fe2008c82 100644 --- a/frontends/atari/statusbar.c +++ b/frontends/atari/statusbar.c @@ -166,7 +166,7 @@ CMP_STATUSBAR sb_create( struct gui_window * gw ) void sb_destroy( CMP_STATUSBAR s ) { - LOG("%s\n", __FUNCTION__); + NSLOG(netsurf, INFO, "%s\n", __FUNCTION__); if( s ) { if( s->comp ){ mt_CompDelete( &app, s->comp ); @@ -206,7 +206,7 @@ CMP_STATUSBAR sb_create( struct gui_window * gw ) void sb_destroy( CMP_STATUSBAR s ) { - LOG("%s\n", __FUNCTION__); + NSLOG(netsurf, INFO, "%s\n", __FUNCTION__); if( s ) { free( s ); } diff --git a/frontends/atari/toolbar.c b/frontends/atari/toolbar.c index 1b9371763..fdfedcbee 100644 --- a/frontends/atari/toolbar.c +++ b/frontends/atari/toolbar.c @@ -269,7 +269,7 @@ struct s_toolbar *toolbar_create(struct s_gui_win_root *owner) int i; struct s_toolbar *t; - LOG("owner %p", owner); + NSLOG(netsurf, INFO, "owner %p", owner); assert(init == true); @@ -327,8 +327,9 @@ struct s_toolbar *toolbar_create(struct s_gui_win_root *owner) t->throbber.max_index = THROBBER_MAX_INDEX; t->throbber.running = false; - LOG("created toolbar: %p, root: %p, textarea: %p, throbber: %p", - t, owner, t->url.textarea, &t->throbber); + NSLOG(netsurf, INFO, + "created toolbar: %p, root: %p, textarea: %p, throbber: %p", t, + owner, t->url.textarea, &t->throbber); return( t ); } @@ -458,7 +459,7 @@ toolbar_update_buttons(struct s_toolbar *tb, struct browser_window *bw, short button) { - LOG("tb %p", tb); + NSLOG(netsurf, INFO, "tb %p", tb); struct s_tb_button * bt; bool enable = false; @@ -582,7 +583,7 @@ void toolbar_set_dimensions(struct s_toolbar *tb, GRECT *area) void toolbar_set_url(struct s_toolbar *tb, const char *text) { - LOG("tb %p", tb); + NSLOG(netsurf, INFO, "tb %p", tb); textarea_set_text(tb->url.textarea, text); @@ -668,7 +669,7 @@ bool toolbar_text_input(struct s_toolbar *tb, char *text) { bool handled = true; - LOG("tb %p", tb); + NSLOG(netsurf, INFO, "tb %p", tb); return(handled); } @@ -757,7 +758,7 @@ void toolbar_mouse_input(struct s_toolbar *tb, short obj, short button) short mx, my, mb, kstat; struct gui_window * gw; - LOG("tb %p", tb); + NSLOG(netsurf, INFO, "tb %p", tb); if (obj==TOOLBAR_AREA_URL) { diff --git a/frontends/atari/treeview.c b/frontends/atari/treeview.c index abc1fa780..23db41309 100644 --- a/frontends/atari/treeview.c +++ b/frontends/atari/treeview.c @@ -362,8 +362,8 @@ static short handle_event(GUIWIN *win, EVMULT_OUT *ev_out, short msg[8]) on_keybd_event(cw, ev_out, msg); } if ((ev_out->emo_events & MU_BUTTON) != 0 ) { - LOG("Treeview click at: %d,%d\n", - ev_out->emo_mouse.p_x, ev_out->emo_mouse.p_y); + NSLOG(netsurf, INFO, "Treeview click at: %d,%d\n", + ev_out->emo_mouse.p_x, ev_out->emo_mouse.p_y); on_mbutton_event(cw, ev_out, msg); } @@ -541,7 +541,7 @@ atari_treeview_create(GUIWIN *win, struct atari_treeview_callbacks * callbacks, tv = calloc(1, sizeof(struct atari_treeview_window)); if (tv == NULL) { - LOG("calloc failed"); + NSLOG(netsurf, INFO, "calloc failed"); atari_warn_user(messages_get_errorcode(NSERROR_NOMEM), 0); return NULL; } diff --git a/frontends/atari/verify_ssl.c b/frontends/atari/verify_ssl.c index 33136eebd..b099fe488 100644 --- a/frontends/atari/verify_ssl.c +++ b/frontends/atari/verify_ssl.c @@ -80,7 +80,9 @@ static void __CDECL cert_info_draw( WINDOW * win, short buf[8], void * data) if( line == NULL ) return; - LOG("Cert info draw, win: %p, data: %p, scrollx: %d", win, data, dp->scrollx ); + NSLOG(netsurf, INFO, + "Cert info draw, win: %p, data: %p, scrollx: %d", win, data, + dp->scrollx); WindGet( win, WF_WORKXYWH, &x, &y, &w, &h ); /*using static values here, as RsrcUserDraw has mem leaks & a very small stack */ @@ -158,7 +160,7 @@ static void do_popup( WINDOW *win, int index, int mode, void *data) char * items[dp->num_certs]; short x, y; unsigned int i; - LOG("do_popup: num certs: %d", dp->num_certs); + NSLOG(netsurf, INFO, "do_popup: num certs: %d", dp->num_certs); for( i = 0; inum_certs; i++) { items[i] = malloc( 48 ); strncpy(items[i], (char*)&dp->cert_infos_n[i].issuer, 46 ); @@ -246,7 +248,7 @@ verify_ssl_form_do(const char * url, break; case VERIFY_BT_SCROLL_R: - LOG("scroll r!"); + NSLOG(netsurf, INFO, "scroll r!"); cont = true; dp.scrollx += 1; if( dp.scrollx > (dp.cols - (272 / 8 )) ) diff --git a/frontends/framebuffer/bitmap.c b/frontends/framebuffer/bitmap.c index 027e0122b..59f68bba5 100644 --- a/frontends/framebuffer/bitmap.c +++ b/frontends/framebuffer/bitmap.c @@ -51,7 +51,8 @@ static void *bitmap_create(int width, int height, unsigned int state) { nsfb_t *bm; - LOG("width %d, height %d, state %u", width, height, state); + NSLOG(netsurf, INFO, "width %d, height %d, state %u", width, height, + state); bm = nsfb_new(NSFB_SURFACE_RAM); if (bm == NULL) { @@ -69,7 +70,7 @@ static void *bitmap_create(int width, int height, unsigned int state) return NULL; } - LOG("bitmap %p", bm); + NSLOG(netsurf, INFO, "bitmap %p", bm); return bm; } @@ -197,11 +198,11 @@ static bool bitmap_test_opaque(void *bitmap) while (tst-- > 0) { if (bmpptr[(tst << 2) + 3] != 0xff) { - LOG("bitmap %p has transparency", bm); + NSLOG(netsurf, INFO, "bitmap %p has transparency", bm); return false; } } - LOG("bitmap %p is opaque", bm); + NSLOG(netsurf, INFO, "bitmap %p is opaque", bm); return true; } @@ -282,7 +283,7 @@ bitmap_render(struct bitmap *bitmap, nsfb_get_geometry(tbm, &width, &height, NULL); - LOG("width %d, height %d", width, height); + NSLOG(netsurf, INFO, "width %d, height %d", width, height); /* Calculate size of buffer to render the content into */ /* We get the width from the content width, unless it exceeds 1024, diff --git a/frontends/framebuffer/clipboard.c b/frontends/framebuffer/clipboard.c index 1254c36f3..20a00e038 100644 --- a/frontends/framebuffer/clipboard.c +++ b/frontends/framebuffer/clipboard.c @@ -53,8 +53,8 @@ static void gui_get_clipboard(char **buffer, size_t *length) if (gui_clipboard.length > 0) { assert(gui_clipboard.buffer != NULL); - LOG("Pasting %zd bytes: \"%s\"\n", - gui_clipboard.length, gui_clipboard.buffer); + NSLOG(netsurf, INFO, "Pasting %zd bytes: \"%s\"\n", + gui_clipboard.length, gui_clipboard.buffer); *buffer = malloc(gui_clipboard.length); diff --git a/frontends/framebuffer/convert_font.c b/frontends/framebuffer/convert_font.c index 010af857a..6d7c4d44e 100644 --- a/frontends/framebuffer/convert_font.c +++ b/frontends/framebuffer/convert_font.c @@ -278,7 +278,8 @@ bool generate_font_header(const char *path, struct font_data *data) fp = fopen(path, "wb"); if (fp == NULL) { - LOG(LOG_ERROR, "Couldn't open header file \"%s\"\n", path); + NSLOG(netsurf, INFO, LOG_ERROR, + "Couldn't open header file \"%s\"\n", path); return false; } @@ -315,7 +316,8 @@ bool generate_font_source(const char *path, struct font_data *data) fp = fopen(path, "wb"); if (fp == NULL) { - LOG(LOG_ERROR, "Couldn't open output file \"%s\"\n", path); + NSLOG(netsurf, INFO, LOG_ERROR, + "Couldn't open output file \"%s\"\n", path); return false; } @@ -413,14 +415,14 @@ static bool add_glyph_to_data(glyph_entry *add, int id, int style, d->e[d->glyphs++] = e; e->index = d->glyphs; if (d->glyphs >= 0xfffd) { - LOG(LOG_ERROR, " Too many glyphs for internal data " - "representation\n"); + NSLOG(netsurf, INFO, LOG_ERROR, + " Too many glyphs for internal data ""representation\n"); return false; } } else { /* Duplicate glyph */ - LOG(LOG_DEBUG, " U+%.4X (%s) is duplicate\n", - id, short_labels[style]); + NSLOG(netsurf, INFO, LOG_DEBUG, + " U+%.4X (%s) is duplicate\n", id, short_labels[style]); } /* Find glyph's section */ @@ -432,8 +434,8 @@ static bool add_glyph_to_data(glyph_entry *add, int id, int style, size_t size = (d->sec_count[style] + 1) * SECTION_SIZE; uint16_t *temp = realloc(d->sections[style], size); if (temp == NULL) { - LOG(LOG_ERROR, " Couldn't increase sections " - "allocation\n"); + NSLOG(netsurf, INFO, LOG_ERROR, + " Couldn't increase sections ""allocation\n"); return false; } memset(temp + d->sec_count[style] * 256, 0, @@ -456,47 +458,50 @@ static bool check_glyph_data_valid(int pos, char c) if (pos == 44) { if (c != '\n') { - LOG(LOG_ERROR, " Invalid glyph data: " - "expecting '\\n', got '%c' (%i)\n", - c, c); + NSLOG(netsurf, INFO, LOG_ERROR, + " Invalid glyph data: ""expecting '\\n', got '%c' (%i)\n", + c, + c); return false; } else { return true; } } else if (pos < 3) { if (c != ' ') { - LOG(LOG_ERROR, " Invalid glyph data: " - "expecting ' ', got '%c' (%i)\n", - c, c); + NSLOG(netsurf, INFO, LOG_ERROR, + " Invalid glyph data: ""expecting ' ', got '%c' (%i)\n", + c, + c); return false; } else { return true; } } else if (offset == 0) { if (c != '\n' && c != ' ') { - LOG(LOG_ERROR, " Invalid glyph data: " - "expecting '\\n' or ' ', " - "got '%c' (%i)\n", - c, c); + NSLOG(netsurf, INFO, LOG_ERROR, + " Invalid glyph data: ""expecting '\\n' or ' ', ""got '%c' (%i)\n", + c, + c); return false; } else { return true; } } else if (offset < 3) { if (c != ' ') { - LOG(LOG_ERROR, " Invalid glyph data: " - "expecting ' ', got '%c' (%i)\n", - c, c); + NSLOG(netsurf, INFO, LOG_ERROR, + " Invalid glyph data: ""expecting ' ', got '%c' (%i)\n", + c, + c); return false; } else { return true; } } else if (offset >= 3 && pos < 11) { if (c != '.' && c != '#') { - LOG(LOG_ERROR, " Invalid glyph data: " - "expecting '.' or '#', " - "got '%c' (%i)\n", - c, c); + NSLOG(netsurf, INFO, LOG_ERROR, + " Invalid glyph data: ""expecting '.' or '#', ""got '%c' (%i)\n", + c, + c); return false; } else { return true; @@ -505,10 +510,10 @@ static bool check_glyph_data_valid(int pos, char c) /* offset must be >=3 */ if (c != '.' && c != '#' && c != ' ') { - LOG(LOG_ERROR, " Invalid glyph data: " - "expecting '.', '#', or ' ', " - "got '%c' (%i)\n", - c, c); + NSLOG(netsurf, INFO, LOG_ERROR, + " Invalid glyph data: ""expecting '.', '#', or ' ', ""got '%c' (%i)\n", + c, + c); return false; } @@ -697,11 +702,11 @@ static bool parse_glyph_data(struct parse_context *ctx, char c, /* Check that character is valid */ if (check_glyph_data_valid(ctx->data.in_gd.pos, c) == false) { - LOG(LOG_ERROR, " Error in U+%.4X data: " - "glyph line: %i, pos: %i\n", - ctx->id, - ctx->data.in_gd.line, - ctx->data.in_gd.pos); + NSLOG(netsurf, INFO, LOG_ERROR, + " Error in U+%.4X data: ""glyph line: %i, pos: %i\n", + ctx->id, + ctx->data.in_gd.line, + ctx->data.in_gd.pos); goto error; } @@ -712,8 +717,8 @@ static bool parse_glyph_data(struct parse_context *ctx, char c, ctx->data.in_gd.e[glyph] = calloc(sizeof(struct glyph_entry), 1); if (ctx->data.in_gd.e[glyph] == NULL) { - LOG(LOG_ERROR, " Couldn't allocate memory for " - "glyph entry\n"); + NSLOG(netsurf, INFO, LOG_ERROR, + " Couldn't allocate memory for ""glyph entry\n"); goto error; } @@ -735,18 +740,17 @@ static bool parse_glyph_data(struct parse_context *ctx, char c, if (c == '\n') { if (ctx->data.in_gd.line == 0) { if (ctx->data.in_gd.e[0] == NULL) { - LOG(LOG_ERROR, " Error in U+%.4X data: " - "\"Regular\" glyph style must " - "be present\n", ctx->id); + NSLOG(netsurf, INFO, LOG_ERROR, + " Error in U+%.4X data: ""\"Regular\" glyph style must ""be present\n", + ctx->id); goto error; } } else if (ctx->data.in_gd.styles != ctx->data.in_gd.line_styles) { - LOG(LOG_ERROR, " Error in U+%.4X data: " - "glyph line: %i " - "styles don't match first line\n", - ctx->id, - ctx->data.in_gd.line); + NSLOG(netsurf, INFO, LOG_ERROR, + " Error in U+%.4X data: ""glyph line: %i ""styles don't match first line\n", + ctx->id, + ctx->data.in_gd.line); goto error; } @@ -764,10 +768,10 @@ static bool parse_glyph_data(struct parse_context *ctx, char c, ctx->count[i] += 1; if (glyph_is_codepoint(ctx->data.in_gd.e[i], ctx->id, i)) { - LOG(LOG_DEBUG, " U+%.4X (%s) is " - "codepoint\n", - ctx->id, - short_labels[i]); + NSLOG(netsurf, INFO, LOG_DEBUG, + " U+%.4X (%s) is ""codepoint\n", + ctx->id, + short_labels[i]); ctx->codepoints += 1; free(ctx->data.in_gd.e[i]); ctx->data.in_gd.e[i] = NULL; @@ -810,7 +814,8 @@ static bool get_hex_digit_value(char c, int *v) else if (c >= 'A' && c <= 'F') *v = (10 + c - 'A'); else { - LOG(LOG_ERROR, "Invalid hex digit '%c' (%i)\n", c, c); + NSLOG(netsurf, INFO, LOG_ERROR, + "Invalid hex digit '%c' (%i)\n", c, c); return false; } @@ -847,14 +852,16 @@ static bool parse_chunk(struct parse_context *ctx, const char *buf, size_t len, while (pos < end) { if (*pos == '\r') { - LOG(LOG_ERROR, "Detected \'\\r\': Bad line ending\n"); + NSLOG(netsurf, INFO, LOG_ERROR, + "Detected \'\\r\': Bad line ending\n"); return false; } switch (ctx->state) { case START: if (*pos != '*') { - LOG(LOG_ERROR, "First character must be '*'\n"); + NSLOG(netsurf, INFO, LOG_ERROR, + "First character must be '*'\n"); printf("Got: %c (%i)\n", *pos, *pos); return false; } @@ -866,12 +873,13 @@ static bool parse_chunk(struct parse_context *ctx, const char *buf, size_t len, case IN_HEADER: if (ctx->data.in_header.new_line == true) { if (*pos != '*') { - LOG(LOG_INFO, " Got header " - "(%i bytes)\n", - d->header_len); - LOG(LOG_DEBUG, " Header:\n\n%.*s\n", - d->header_len, - d->header); + NSLOG(netsurf, INFO, LOG_INFO, + " Got header ""(%i bytes)\n", + d->header_len); + NSLOG(netsurf, INFO, LOG_DEBUG, + " Header:\n\n%.*s\n", + d->header_len, + d->header); ctx->data.before_id.new_line = false; ctx->data.before_id.u = false; ctx->state = BEFORE_ID; @@ -886,9 +894,9 @@ static bool parse_chunk(struct parse_context *ctx, const char *buf, size_t len, } if (d->header_len == HEADER_MAX) { - LOG(LOG_ERROR, " Header too long " - "(>%i bytes)\n", - d->header_len); + NSLOG(netsurf, INFO, LOG_ERROR, + " Header too long ""(>%i bytes)\n", + d->header_len); return false; } @@ -922,7 +930,8 @@ static bool parse_chunk(struct parse_context *ctx, const char *buf, size_t len, ok = assemble_codepoint(pos, ctx->data.g_id.c++, &ctx->id); if (!ok) { - LOG(LOG_ERROR, " Invalid glyph ID\n"); + NSLOG(netsurf, INFO, LOG_ERROR, + " Invalid glyph ID\n"); return false; } @@ -994,8 +1003,8 @@ static bool parse_chunk(struct parse_context *ctx, const char *buf, size_t len, } for (i = 0; i < 4; i++) { - LOG(LOG_DEBUG, " %s: %i gylphs\n", labels[i], - ctx->count[i] - count[i]); + NSLOG(netsurf, INFO, LOG_DEBUG, " %s: %i gylphs\n", + labels[i], ctx->count[i] - count[i]); } return true; @@ -1019,13 +1028,15 @@ bool load_font(const char *path, struct font_data **data) fp = fopen(path, "rb"); if (fp == NULL) { - LOG(LOG_ERROR, "Couldn't open font data file\n"); + NSLOG(netsurf, INFO, LOG_ERROR, + "Couldn't open font data file\n"); return false; } d = calloc(sizeof(struct font_data), 1); if (d == NULL) { - LOG(LOG_ERROR, "Couldn't allocate memory for font data\n"); + NSLOG(netsurf, INFO, LOG_ERROR, + "Couldn't allocate memory for font data\n"); fclose(fp); return false; } @@ -1034,18 +1045,19 @@ bool load_font(const char *path, struct font_data **data) fseek(fp, 0L, SEEK_END); file_len = ftell(fp); if (file_len == -1) { - LOG(LOG_ERROR, "Could not size input file\n"); + NSLOG(netsurf, INFO, LOG_ERROR, "Could not size input file\n"); free(d); fclose(fp); return false; } fseek(fp, 0L, SEEK_SET); - LOG(LOG_DEBUG, "Input size: %zu bytes\n", file_len); + NSLOG(netsurf, INFO, LOG_DEBUG, "Input size: %zu bytes\n", file_len); /* Allocate buffer for data chunks */ buf = malloc(CHUNK_SIZE); if (buf == NULL) { - LOG(LOG_ERROR, "Couldn't allocate memory for input buffer\n"); + NSLOG(netsurf, INFO, LOG_ERROR, + "Couldn't allocate memory for input buffer\n"); free(d); fclose(fp); return false; @@ -1054,20 +1066,24 @@ bool load_font(const char *path, struct font_data **data) /* Initialise parser */ parse_init(&ctx); - LOG(LOG_DEBUG, "Using chunk size of %i bytes\n", CHUNK_SIZE); + NSLOG(netsurf, INFO, LOG_DEBUG, "Using chunk size of %i bytes\n", + CHUNK_SIZE); /* Parse the input file in chunks */ for (done = 0; done < file_len; done += CHUNK_SIZE) { - LOG(LOG_INFO, "Parsing input chunk %zu\n", done / CHUNK_SIZE); + NSLOG(netsurf, INFO, LOG_INFO, "Parsing input chunk %zu\n", + done / CHUNK_SIZE); /* Read chunk */ len = fread(buf, 1, CHUNK_SIZE, fp); if (file_len - done < CHUNK_SIZE && len != file_len - done) { - LOG(LOG_WARNING, "Last chunk has suspicious size\n"); + NSLOG(netsurf, INFO, LOG_WARNING, + "Last chunk has suspicious size\n"); } else if (file_len - done >= CHUNK_SIZE && len != CHUNK_SIZE) { - LOG(LOG_ERROR, "Problem reading file\n"); + NSLOG(netsurf, INFO, LOG_ERROR, + "Problem reading file\n"); free(buf); free(d); fclose(fp); @@ -1082,29 +1098,33 @@ bool load_font(const char *path, struct font_data **data) fclose(fp); return false; } - LOG(LOG_DEBUG, "Parsed %zu bytes\n", done + len); + NSLOG(netsurf, INFO, LOG_DEBUG, "Parsed %zu bytes\n", + done + len); } fclose(fp); if (ctx.state != BEFORE_ID) { - LOG(LOG_ERROR, "Unexpected end of file\n"); + NSLOG(netsurf, INFO, LOG_ERROR, "Unexpected end of file\n"); free(buf); free(d); return false; } - LOG(LOG_INFO, "Parsing complete:\n"); + NSLOG(netsurf, INFO, LOG_INFO, "Parsing complete:\n"); count = 0; for (i = 0; i < 4; i++) { - LOG(LOG_INFO, " %s: %i gylphs\n", labels[i], ctx.count[i]); + NSLOG(netsurf, INFO, LOG_INFO, " %s: %i gylphs\n", + labels[i], ctx.count[i]); count += ctx.count[i]; } - LOG(LOG_RESULT, " Total %i gylphs " - "(of which %i unique, %i codepoints, %i duplicates)\n", - count, d->glyphs, ctx.codepoints, - count - d->glyphs - ctx.codepoints); + NSLOG(netsurf, INFO, LOG_RESULT, + " Total %i gylphs ""(of which %i unique, %i codepoints, %i duplicates)\n", + count, + d->glyphs, + ctx.codepoints, + count - d->glyphs - ctx.codepoints); free(buf); @@ -1115,16 +1135,9 @@ bool load_font(const char *path, struct font_data **data) static void log_usage(const char *argv0) { level = LOG_INFO; - LOG(LOG_INFO, - "Usage:\n" - "\t%s [options] \n" - "\n" - "Options:\n" - "\t--help -h Display this text\n" - "\t--quiet -q Don't show warnings\n" - "\t--verbose -v Verbose output\n" - "\t--debug -d Full debug output\n", - argv0); + NSLOG(netsurf, INFO, LOG_INFO, + "Usage:\n""\t%s [options] \n""\n""Options:\n""\t--help -h Display this text\n""\t--quiet -q Don't show warnings\n""\t--verbose -v Verbose output\n""\t--debug -d Full debug output\n", + argv0); } int main(int argc, char** argv) @@ -1187,8 +1200,9 @@ int main(int argc, char** argv) in_path = argv[optind]; out_path = argv[optind + 1]; - LOG(LOG_DEBUG, "Using input path: \"%s\"\n", in_path); - LOG(LOG_DEBUG, "Using output path: \"%s\"\n", out_path); + NSLOG(netsurf, INFO, LOG_DEBUG, "Using input path: \"%s\"\n", in_path); + NSLOG(netsurf, INFO, LOG_DEBUG, "Using output path: \"%s\"\n", + out_path); ok = load_font(in_path, &data); if (!ok) { diff --git a/frontends/framebuffer/fbtk/event.c b/frontends/framebuffer/fbtk/event.c index a48e63809..84c6c3791 100644 --- a/frontends/framebuffer/fbtk/event.c +++ b/frontends/framebuffer/fbtk/event.c @@ -51,7 +51,7 @@ fbtk_input(fbtk_widget_t *root, nsfb_event_t *event) /* obtain widget with input focus */ input = root->u.root.input; if (input == NULL) { - LOG("No widget has input focus."); + NSLOG(netsurf, INFO, "No widget has input focus."); return; /* no widget with input */ } @@ -84,7 +84,7 @@ fbtk_click(fbtk_widget_t *widget, nsfb_event_t *event) x = fbtk_get_absx(clicked); y = fbtk_get_absy(clicked); - LOG("clicked %p at %d,%d", clicked, x, y); + NSLOG(netsurf, INFO, "clicked %p at %d,%d", clicked, x, y); /* post the click */ fbtk_post_callback(clicked, FBTK_CBT_CLICK, event, cloc.x0 - x, cloc.y0 - y); diff --git a/frontends/framebuffer/fbtk/fbtk.c b/frontends/framebuffer/fbtk/fbtk.c index c63a6d8c9..a0b0f6660 100644 --- a/frontends/framebuffer/fbtk/fbtk.c +++ b/frontends/framebuffer/fbtk/fbtk.c @@ -53,7 +53,7 @@ dump_tk_tree(fbtk_widget_t *widget) int indent = 0; while (widget != NULL) { - LOG("%*s%p", indent, "", widget); + NSLOG(netsurf, INFO, "%*s%p", indent, "", widget); if (widget->first_child != NULL) { widget = widget->first_child; indent += 6; @@ -101,7 +101,9 @@ fbtk_request_redraw(fbtk_widget_t *widget) widget->redraw.height = widget->height; #ifdef FBTK_LOGGING - LOG("redrawing %p %d,%d %d,%d", widget, widget->redraw.x, widget->redraw.y, widget->redraw.width, widget->redraw.height); + NSLOG(netsurf, INFO, "redrawing %p %d,%d %d,%d", widget, + widget->redraw.x, widget->redraw.y, widget->redraw.width, + widget->redraw.height); #endif cwidget = widget->last_child; @@ -122,7 +124,7 @@ fbtk_request_redraw(fbtk_widget_t *widget) int fbtk_set_mapping(fbtk_widget_t *widget, bool map) { - LOG("setting mapping on %p to %d", widget, map); + NSLOG(netsurf, INFO, "setting mapping on %p to %d", widget, map); widget->mapped = map; if (map) { fbtk_request_redraw(widget); @@ -145,7 +147,7 @@ swap_siblings(fbtk_widget_t *lw) assert(rw != NULL); - LOG("Swapping %p with %p", lw, rw); + NSLOG(netsurf, INFO, "Swapping %p with %p", lw, rw); before = lw->prev; after = rw->next; @@ -411,7 +413,8 @@ fbtk_get_root_widget(fbtk_widget_t *widget) /* check root widget was found */ if (widget->type != FB_WIDGET_TYPE_ROOT) { - LOG("Widget with null parent that is not the root widget!"); + NSLOG(netsurf, INFO, + "Widget with null parent that is not the root widget!"); return NULL; } @@ -552,7 +555,8 @@ fbtk_widget_new(fbtk_widget_t *parent, return NULL; #ifdef FBTK_LOGGING - LOG("creating %p %d,%d %d,%d", neww, x, y, width, height); + NSLOG(netsurf, INFO, "creating %p %d,%d %d,%d", neww, x, y, width, + height); #endif /* make new window fit inside parent */ @@ -575,7 +579,8 @@ fbtk_widget_new(fbtk_widget_t *parent, } #ifdef FBTK_LOGGING - LOG("using %p %d,%d %d,%d", neww, x, y, width, height); + NSLOG(netsurf, INFO, "using %p %d,%d %d,%d", neww, x, y, width, + height); #endif /* set values */ neww->type = type; @@ -635,7 +640,8 @@ do_redraw(nsfb_t *nsfb, fbtk_widget_t *widget) plot_ctx.y1 = plot_ctx.y0 + widget->redraw.height; #ifdef FBTK_LOGGING - LOG("clipping %p %d,%d %d,%d", widget, plot_ctx.x0, plot_ctx.y0, plot_ctx.x1, plot_ctx.y1); + NSLOG(netsurf, INFO, "clipping %p %d,%d %d,%d", widget, + plot_ctx.x0, plot_ctx.y0, plot_ctx.x1, plot_ctx.y1); #endif if (nsfb_plot_set_clip(nsfb, &plot_ctx) == true) { fbtk_post_callback(widget, FBTK_CBT_REDRAW); diff --git a/frontends/framebuffer/fbtk/scroll.c b/frontends/framebuffer/fbtk/scroll.c index cc98fb2dd..b056ac81f 100644 --- a/frontends/framebuffer/fbtk/scroll.c +++ b/frontends/framebuffer/fbtk/scroll.c @@ -334,7 +334,7 @@ hscroll_redraw(fbtk_widget_t *widget, fbtk_callback_info *cbi) hpos = 0; } - LOG("hscroll %d", hscroll); + NSLOG(netsurf, INFO, "hscroll %d", hscroll); rect.x0 = bbox.x0 + 3 + hpos; rect.y0 = bbox.y0 + 5; @@ -362,7 +362,7 @@ hscrolll_click(fbtk_widget_t *widget, fbtk_callback_info *cbi) newpos = scrollw->u.scroll.minimum; if (newpos == scrollw->u.scroll.position) { - LOG("horiz scroll was the same %d", newpos); + NSLOG(netsurf, INFO, "horiz scroll was the same %d", newpos); return 0; } diff --git a/frontends/framebuffer/fetch.c b/frontends/framebuffer/fetch.c index 801b87a74..23cbb4f21 100644 --- a/frontends/framebuffer/fetch.c +++ b/frontends/framebuffer/fetch.c @@ -65,7 +65,7 @@ static nsurl *get_resource_url(const char *path) static const char *fetch_filetype(const char *unix_path) { int l; - LOG("unix path %s", unix_path); + NSLOG(netsurf, INFO, "unix path %s", unix_path); l = strlen(unix_path); if (2 < l && strcasecmp(unix_path + l - 3, "css") == 0) return "text/css"; diff --git a/frontends/framebuffer/font_freetype.c b/frontends/framebuffer/font_freetype.c index e7c07f5ff..9e47e4b99 100644 --- a/frontends/framebuffer/font_freetype.c +++ b/frontends/framebuffer/font_freetype.c @@ -90,12 +90,13 @@ ft_face_requester(FTC_FaceID face_id, error = FT_New_Face(library, fb_face->fontfile, fb_face->index, face); if (error) { - LOG("Could not find font (code %d)", error); + NSLOG(netsurf, INFO, "Could not find font (code %d)", error); } else { error = FT_Select_Charmap(*face, FT_ENCODING_UNICODE); if (error) { - LOG("Could not select charmap (code %d)", error); + NSLOG(netsurf, INFO, + "Could not select charmap (code %d)", error); } else { for (cidx = 0; cidx < (*face)->num_charmaps; cidx++) { if ((*face)->charmap == (*face)->charmaps[cidx]) { @@ -105,7 +106,7 @@ ft_face_requester(FTC_FaceID face_id, } } } - LOG("Loaded face from %s", fb_face->fontfile); + NSLOG(netsurf, INFO, "Loaded face from %s", fb_face->fontfile); return error; } @@ -132,7 +133,8 @@ fb_new_face(const char *option, const char *resname, const char *fontname) error = FTC_Manager_LookupFace(ft_cmanager, (FTC_FaceID)newf, &aface); if (error) { - LOG("Could not find font face %s (code %d)", fontname, error); + NSLOG(netsurf, INFO, "Could not find font face %s (code %d)", + fontname, error); free(newf->fontfile); free(newf); newf = NULL; @@ -152,7 +154,8 @@ bool fb_font_init(void) /* freetype library initialise */ error = FT_Init_FreeType( &library ); if (error) { - LOG("Freetype could not initialised (code %d)", error); + NSLOG(netsurf, INFO, + "Freetype could not initialised (code %d)", error); return false; } @@ -172,7 +175,9 @@ bool fb_font_init(void) NULL, &ft_cmanager); if (error) { - LOG("Freetype could not initialise cache manager (code %d)", error); + NSLOG(netsurf, INFO, + "Freetype could not initialise cache manager (code %d)", + error); FT_Done_FreeType(library); return false; } @@ -189,7 +194,7 @@ bool fb_font_init(void) NETSURF_FB_FONT_SANS_SERIF); if (fb_face == NULL) { /* The sans serif font is the default and must be found. */ - LOG("Could not find the default font"); + NSLOG(netsurf, INFO, "Could not find the default font"); FTC_Manager_Done(ft_cmanager); FT_Done_FreeType(library); return false; diff --git a/frontends/framebuffer/framebuffer.c b/frontends/framebuffer/framebuffer.c index de8a3695d..2ccc75062 100644 --- a/frontends/framebuffer/framebuffer.c +++ b/frontends/framebuffer/framebuffer.c @@ -271,7 +271,7 @@ framebuffer_plot_path(const struct redraw_context *ctx, float width, const float transform[6]) { - LOG("path unimplemented"); + NSLOG(netsurf, INFO, "path unimplemented"); return NSERROR_OK; } @@ -564,7 +564,7 @@ static bool framebuffer_format_from_bpp(int bpp, enum nsfb_format_e *fmt) break; default: - LOG("Bad bits per pixel (%d)\n", bpp); + NSLOG(netsurf, INFO, "Bad bits per pixel (%d)\n", bpp); return false; } @@ -586,18 +586,19 @@ framebuffer_initialise(const char *fename, int width, int height, int bpp) fbtype = nsfb_type_from_name(fename); if (fbtype == NSFB_SURFACE_NONE) { - LOG("The %s surface is not available from libnsfb\n", fename); + NSLOG(netsurf, INFO, + "The %s surface is not available from libnsfb\n", fename); return NULL; } nsfb = nsfb_new(fbtype); if (nsfb == NULL) { - LOG("Unable to create %s fb surface\n", fename); + NSLOG(netsurf, INFO, "Unable to create %s fb surface\n", fename); return NULL; } if (nsfb_set_geometry(nsfb, width, height, fbfmt) == -1) { - LOG("Unable to set surface geometry\n"); + NSLOG(netsurf, INFO, "Unable to set surface geometry\n"); nsfb_free(nsfb); return NULL; } @@ -605,7 +606,7 @@ framebuffer_initialise(const char *fename, int width, int height, int bpp) nsfb_cursor_init(nsfb); if (nsfb_init(nsfb) == -1) { - LOG("Unable to initialise nsfb surface\n"); + NSLOG(netsurf, INFO, "Unable to initialise nsfb surface\n"); nsfb_free(nsfb); return NULL; } @@ -625,7 +626,7 @@ framebuffer_resize(nsfb_t *nsfb, int width, int height, int bpp) } if (nsfb_set_geometry(nsfb, width, height, fbfmt) == -1) { - LOG("Unable to change surface geometry\n"); + NSLOG(netsurf, INFO, "Unable to change surface geometry\n"); return false; } diff --git a/frontends/framebuffer/gui.c b/frontends/framebuffer/gui.c index 1460c77f6..ebd0b7b66 100644 --- a/frontends/framebuffer/gui.c +++ b/frontends/framebuffer/gui.c @@ -120,7 +120,7 @@ static void die(const char *error) */ static nserror fb_warn_user(const char *warning, const char *detail) { - LOG("%s %s", warning, detail); + NSLOG(netsurf, INFO, "%s %s", warning, detail); return NSERROR_OK; } @@ -153,7 +153,7 @@ widget_scroll_y(struct gui_window *gw, int y, bool abs) int content_width, content_height; int height; - LOG("window scroll"); + NSLOG(netsurf, INFO, "window scroll"); if (abs) { bwidget->pany = y - bwidget->scrolly; } else { @@ -237,7 +237,7 @@ fb_pan(fbtk_widget_t *widget, height = fbtk_get_height(widget); width = fbtk_get_width(widget); - LOG("panning %d, %d", bwidget->panx, bwidget->pany); + NSLOG(netsurf, INFO, "panning %d, %d", bwidget->panx, bwidget->pany); x = fbtk_get_absx(widget); y = fbtk_get_absy(widget); @@ -413,7 +413,8 @@ fb_browser_window_redraw(fbtk_widget_t *widget, fbtk_callback_info *cbi) bwidget = fbtk_get_userpw(widget); if (bwidget == NULL) { - LOG("browser widget from widget %p was null", widget); + NSLOG(netsurf, INFO, + "browser widget from widget %p was null", widget); return -1; } @@ -465,7 +466,7 @@ process_cmdline(int argc, char** argv) {0, 0, 0, 0 } }; /* no long options */ - LOG("argc %d, argv %p", argc, argv); + NSLOG(netsurf, INFO, "argc %d, argv %p", argc, argv); fename = "sdl"; febpp = 32; @@ -534,7 +535,7 @@ static nserror set_defaults(struct nsoption_s *defaults) if (nsoption_charp(cookie_file) == NULL || nsoption_charp(cookie_jar) == NULL) { - LOG("Failed initialising cookie options"); + NSLOG(netsurf, INFO, "Failed initialising cookie options"); return NSERROR_BAD_PARAMETER; } @@ -612,7 +613,7 @@ static void framebuffer_run(void) static void gui_quit(void) { - LOG("gui_quit"); + NSLOG(netsurf, INFO, "gui_quit"); urldb_save_cookies(nsoption_charp(cookie_jar)); @@ -639,7 +640,8 @@ fb_browser_window_click(fbtk_widget_t *widget, fbtk_callback_info *cbi) cbi->event->type != NSFB_EVENT_KEY_UP) return 0; - LOG("browser window clicked at %d,%d", cbi->x, cbi->y); + NSLOG(netsurf, INFO, "browser window clicked at %d,%d", cbi->x, + cbi->y); switch (cbi->event->type) { case NSFB_EVENT_KEY_DOWN: @@ -824,7 +826,7 @@ fb_browser_window_input(fbtk_widget_t *widget, fbtk_callback_info *cbi) static fbtk_modifier_type modifier = FBTK_MOD_CLEAR; int ucs4 = -1; - LOG("got value %d", cbi->event->value.keycode); + NSLOG(netsurf, INFO, "got value %d", cbi->event->value.keycode); switch (cbi->event->type) { case NSFB_EVENT_KEY_DOWN: @@ -1200,7 +1202,7 @@ create_toolbar(struct gui_window *gw, toolbar_layout = NSFB_TOOLBAR_DEFAULT_LAYOUT; } - LOG("Using toolbar layout %s", toolbar_layout); + NSLOG(netsurf, INFO, "Using toolbar layout %s", toolbar_layout); itmtype = toolbar_layout; @@ -1234,7 +1236,7 @@ create_toolbar(struct gui_window *gw, (*itmtype != 0) && (xdir !=0)) { - LOG("toolbar adding %c", *itmtype); + NSLOG(netsurf, INFO, "toolbar adding %c", *itmtype); switch (*itmtype) { @@ -1376,7 +1378,9 @@ create_toolbar(struct gui_window *gw, default: widget = NULL; xdir = 0; - LOG("Unknown element %c in toolbar layout", *itmtype); + NSLOG(netsurf, INFO, + "Unknown element %c in toolbar layout", + *itmtype); break; } @@ -1385,7 +1389,7 @@ create_toolbar(struct gui_window *gw, xpos += (xdir * (fbtk_get_width(widget) + padding)); } - LOG("xpos is %d", xpos); + NSLOG(netsurf, INFO, "xpos is %d", xpos); itmtype += xdir; } @@ -1595,7 +1599,7 @@ create_normal_browser_window(struct gui_window *gw, int furniture_width) int statusbar_width = 0; int toolbar_height = nsoption_int(fb_toolbar_size); - LOG("Normal window"); + NSLOG(netsurf, INFO, "Normal window"); gw->window = fbtk_create_window(fbtk, 0, 0, 0, 0, 0); @@ -1626,7 +1630,8 @@ create_normal_browser_window(struct gui_window *gw, int furniture_width) false); fbtk_set_handler(gw->status, FBTK_CBT_POINTERENTER, set_ptr_default_move, NULL); - LOG("status bar %p at %d,%d", gw->status, fbtk_get_absx(gw->status), fbtk_get_absy(gw->status)); + NSLOG(netsurf, INFO, "status bar %p at %d,%d", gw->status, + fbtk_get_absx(gw->status), fbtk_get_absy(gw->status)); /* create horizontal scrollbar */ gw->hscroll = fbtk_create_hscroll(gw->window, @@ -2183,7 +2188,7 @@ main(int argc, char** argv) /* create an initial browser window */ - LOG("calling browser_window_create"); + NSLOG(netsurf, INFO, "calling browser_window_create"); ret = nsurl_create(feurl, &url); if (ret == NSERROR_OK) { @@ -2205,7 +2210,7 @@ main(int argc, char** argv) netsurf_exit(); if (fb_font_finalise() == false) - LOG("Font finalisation failed."); + NSLOG(netsurf, INFO, "Font finalisation failed."); /* finalise options */ nsoption_finalise(nsoptions, nsoptions_default); diff --git a/frontends/framebuffer/schedule.c b/frontends/framebuffer/schedule.c index 581ad72f1..c94cead44 100644 --- a/frontends/framebuffer/schedule.c +++ b/frontends/framebuffer/schedule.c @@ -203,12 +203,14 @@ void list_schedule(void) gettimeofday(&tv, NULL); - LOG("schedule list at %ld:%ld", tv.tv_sec, tv.tv_usec); + NSLOG(netsurf, INFO, "schedule list at %ld:%ld", tv.tv_sec, + tv.tv_usec); cur_nscb = schedule_list; while (cur_nscb != NULL) { - LOG("Schedule %p at %ld:%ld", cur_nscb, cur_nscb->tv.tv_sec, cur_nscb->tv.tv_usec); + NSLOG(netsurf, INFO, "Schedule %p at %ld:%ld", cur_nscb, + cur_nscb->tv.tv_sec, cur_nscb->tv.tv_usec); cur_nscb = cur_nscb->next; } } diff --git a/frontends/gtk/cookies.c b/frontends/gtk/cookies.c index 500cd07f6..1f7833cca 100644 --- a/frontends/gtk/cookies.c +++ b/frontends/gtk/cookies.c @@ -164,8 +164,9 @@ static void nsgtk_cookies_init_menu(struct nsgtk_cookie_window *ncwin) w = GTK_WIDGET(gtk_builder_get_object(ncwin->builder, event->widget)); if (w == NULL) { - LOG("Unable to connect menu widget ""%s""", - event->widget); + NSLOG(netsurf, INFO, + "Unable to connect menu widget ""%s""", + event->widget); } else { g_signal_connect(G_OBJECT(w), "activate", @@ -253,7 +254,7 @@ static nserror nsgtk_cookies_init(void) res = nsgtk_builder_new_from_resname("cookies", &ncwin->builder); if (res != NSERROR_OK) { - LOG("Cookie UI builder init failed"); + NSLOG(netsurf, INFO, "Cookie UI builder init failed"); free(ncwin); return res; } diff --git a/frontends/gtk/corewindow.c b/frontends/gtk/corewindow.c index ddc61c717..53ee17333 100644 --- a/frontends/gtk/corewindow.c +++ b/frontends/gtk/corewindow.c @@ -413,14 +413,14 @@ nsgtk_cw_keypress_event(GtkWidget *widget, GdkEventKey *event, gpointer g) if (res == NSERROR_OK) { return TRUE; } else if (res != NSERROR_NOT_IMPLEMENTED) { - LOG("%s", messages_get_errorcode(res)); + NSLOG(netsurf, INFO, "%s", messages_get_errorcode(res)); return FALSE; } /* deal with unprocessed keypress */ res = nsgtk_cw_key(nsgtk_cw, nskey); if (res != NSERROR_OK) { - LOG("%s", messages_get_errorcode(res)); + NSLOG(netsurf, INFO, "%s", messages_get_errorcode(res)); return FALSE; } return TRUE; diff --git a/frontends/gtk/download.c b/frontends/gtk/download.c index 8c8161459..576960271 100644 --- a/frontends/gtk/download.c +++ b/frontends/gtk/download.c @@ -475,7 +475,7 @@ nserror nsgtk_download_init(void) res = nsgtk_builder_new_from_resname("downloads", &builder); if (res != NSERROR_OK) { - LOG("Download UI builder init failed"); + NSLOG(netsurf, INFO, "Download UI builder init failed"); return res; } diff --git a/frontends/gtk/fetch.c b/frontends/gtk/fetch.c index 154f43708..7286aec34 100644 --- a/frontends/gtk/fetch.c +++ b/frontends/gtk/fetch.c @@ -90,7 +90,8 @@ void gtk_fetch_filetype_init(const char *mimefile) fh = fopen(mimefile, "r"); if (fh == NULL) { - LOG("Unable to open a mime.types file, so using a minimal one for you."); + NSLOG(netsurf, INFO, + "Unable to open a mime.types file, so using a minimal one for you."); return; } diff --git a/frontends/gtk/gdk.c b/frontends/gtk/gdk.c index 9ed90bd8e..fd82af5b2 100644 --- a/frontends/gtk/gdk.c +++ b/frontends/gtk/gdk.c @@ -86,7 +86,7 @@ nsgdk_pixbuf_get_from_surface(cairo_surface_t *surface, int scwidth, int scheigh if (cairo_surface_status(scsurface) != CAIRO_STATUS_SUCCESS) { cairo_surface_destroy(scsurface); g_object_unref(pixbuf); - LOG("Surface creation failed"); + NSLOG(netsurf, INFO, "Surface creation failed"); return NULL; } diff --git a/frontends/gtk/global_history.c b/frontends/gtk/global_history.c index 360eb4e1a..f204168d0 100644 --- a/frontends/gtk/global_history.c +++ b/frontends/gtk/global_history.c @@ -214,8 +214,9 @@ nsgtk_global_history_init_menu(struct nsgtk_global_history_window *ghwin) w = GTK_WIDGET(gtk_builder_get_object(ghwin->builder, event->widget)); if (w == NULL) { - LOG("Unable to connect menu widget ""%s""", - event->widget); + NSLOG(netsurf, INFO, + "Unable to connect menu widget ""%s""", + event->widget); } else { g_signal_connect(G_OBJECT(w), "activate", @@ -306,7 +307,7 @@ static nserror nsgtk_global_history_init(void) res = nsgtk_builder_new_from_resname("globalhistory", &ncwin->builder); if (res != NSERROR_OK) { - LOG("History UI builder init failed"); + NSLOG(netsurf, INFO, "History UI builder init failed"); free(ncwin); return res; } diff --git a/frontends/gtk/gui.c b/frontends/gtk/gui.c index a183e521f..6a61b3d06 100644 --- a/frontends/gtk/gui.c +++ b/frontends/gtk/gui.c @@ -208,7 +208,8 @@ static nserror set_defaults(struct nsoption_s *defaults) (nsoption_charp(hotlist_path) == NULL) || (nsoption_charp(downloads_directory) == NULL) || (nsoption_charp(ca_path) == NULL)) { - LOG("Failed initialising default resource paths"); + NSLOG(netsurf, INFO, + "Failed initialising default resource paths"); return NSERROR_BAD_PARAMETER; } @@ -238,7 +239,7 @@ static nserror nsgtk_init(int argc, char** argv, char **respath) error = nsgtk_builder_new_from_resname("warning", &warning_builder); if (error != NSERROR_OK) { - LOG("Unable to initialise warning dialog"); + NSLOG(netsurf, INFO, "Unable to initialise warning dialog"); return error; } @@ -248,7 +249,7 @@ static nserror nsgtk_init(int argc, char** argv, char **respath) error = nsgdk_pixbuf_new_from_resname("netsurf.xpm", &win_default_icon_pixbuf); if (error == NSERROR_OK) { - LOG("Seting default window icon"); + NSLOG(netsurf, INFO, "Seting default window icon"); gtk_window_set_default_icon(win_default_icon_pixbuf); } @@ -256,7 +257,8 @@ static nserror nsgtk_init(int argc, char** argv, char **respath) resource_filename = filepath_find(respath, "SearchEngines"); search_web_init(resource_filename); if (resource_filename != NULL) { - LOG("Using '%s' as Search Engines file", resource_filename); + NSLOG(netsurf, INFO, "Using '%s' as Search Engines file", + resource_filename); free(resource_filename); } @@ -278,7 +280,7 @@ static nserror nsgtk_init(int argc, char** argv, char **respath) /* initialise throbber */ error = nsgtk_throbber_init(); if (error != NSERROR_OK) { - LOG("Unable to initialise throbber."); + NSLOG(netsurf, INFO, "Unable to initialise throbber."); return error; } @@ -300,12 +302,12 @@ static nserror nsgtk_init(int argc, char** argv, char **respath) * window. */ browser_set_dpi(gdk_screen_get_resolution(gdk_screen_get_default())); - LOG("Set CSS DPI to %d", browser_get_dpi()); + NSLOG(netsurf, INFO, "Set CSS DPI to %d", browser_get_dpi()); /* Initialise top level UI elements */ error = nsgtk_download_init(); if (error != NSERROR_OK) { - LOG("Unable to initialise download window."); + NSLOG(netsurf, INFO, "Unable to initialise download window."); return error; } @@ -426,7 +428,7 @@ static void gui_quit(void) { nserror res; - LOG("Quitting GUI"); + NSLOG(netsurf, INFO, "Quitting GUI"); /* Ensure all scaffoldings are destroyed before we go into exit */ nsgtk_download_destroy(); @@ -435,32 +437,34 @@ static void gui_quit(void) res = nsgtk_cookies_destroy(); if (res != NSERROR_OK) { - LOG("Error finalising cookie viewer: %s", - messages_get_errorcode(res)); + NSLOG(netsurf, INFO, "Error finalising cookie viewer: %s", + messages_get_errorcode(res)); } res = nsgtk_local_history_destroy(); if (res != NSERROR_OK) { - LOG("Error finalising local history viewer: %s", - messages_get_errorcode(res)); + NSLOG(netsurf, INFO, + "Error finalising local history viewer: %s", + messages_get_errorcode(res)); } res = nsgtk_global_history_destroy(); if (res != NSERROR_OK) { - LOG("Error finalising global history viewer: %s", - messages_get_errorcode(res)); + NSLOG(netsurf, INFO, + "Error finalising global history viewer: %s", + messages_get_errorcode(res)); } res = nsgtk_hotlist_destroy(); if (res != NSERROR_OK) { - LOG("Error finalising hotlist viewer: %s", - messages_get_errorcode(res)); + NSLOG(netsurf, INFO, "Error finalising hotlist viewer: %s", + messages_get_errorcode(res)); } res = hotlist_fini(); if (res != NSERROR_OK) { - LOG("Error finalising hotlist: %s", - messages_get_errorcode(res)); + NSLOG(netsurf, INFO, "Error finalising hotlist: %s", + messages_get_errorcode(res)); } free(nsgtk_config_home); @@ -492,7 +496,7 @@ nserror nsgtk_warning(const char *warning, const char *detail) static GtkWindow *nsgtk_warning_window; GtkLabel *WarningLabel; - LOG("%s %s", warning, detail ? detail : ""); + NSLOG(netsurf, INFO, "%s %s", warning, detail ? detail : ""); fflush(stdout); nsgtk_warning_window = GTK_WINDOW(gtk_builder_get_object(warning_builder, "wndWarning")); @@ -600,7 +604,7 @@ static void nsgtk_pdf_password(char **owner_pass, char **user_pass, char *path) res = nsgtk_builder_new_from_resname("password", &password_builder); if (res != NSERROR_OK) { - LOG("Password UI builder init failed"); + NSLOG(netsurf, INFO, "Password UI builder init failed"); return; } @@ -821,7 +825,7 @@ static nserror get_config_home(char **config_home_out) if (home_dir != NULL) { ret = check_dirname(home_dir, ".netsurf", &config_home); if (ret == NSERROR_OK) { - LOG("\"%s\"", config_home); + NSLOG(netsurf, INFO, "\"%s\"", config_home); *config_home_out = config_home; return ret; } @@ -861,7 +865,7 @@ static nserror get_config_home(char **config_home_out) } } - LOG("\"%s\"", config_home); + NSLOG(netsurf, INFO, "\"%s\"", config_home); *config_home_out = config_home; return NSERROR_OK; @@ -874,7 +878,7 @@ static nserror create_config_home(char **config_home_out) char *xdg_config_dir; nserror ret; - LOG("Attempting to create configuration directory"); + NSLOG(netsurf, INFO, "Attempting to create configuration directory"); /* $XDG_CONFIG_HOME defines the base directory * relative to which user specific configuration files @@ -910,7 +914,7 @@ static nserror create_config_home(char **config_home_out) /* strip the trailing separator */ config_home[strlen(config_home) - 1] = 0; - LOG("\"%s\"", config_home); + NSLOG(netsurf, INFO, "\"%s\"", config_home); *config_home_out = config_home; @@ -959,7 +963,7 @@ static nserror get_cache_home(char **cache_home_out) } } - LOG("\"%s\"", cache_home); + NSLOG(netsurf, INFO, "\"%s\"", cache_home); *cache_home_out = cache_home; return NSERROR_OK; @@ -972,7 +976,7 @@ static nserror create_cache_home(char **cache_home_out) char *xdg_cache_dir; nserror ret; - LOG("Attempting to create configuration directory"); + NSLOG(netsurf, INFO, "Attempting to create configuration directory"); /* $XDG_CACHE_HOME defines the base directory * relative to which user specific cache files @@ -1008,7 +1012,7 @@ static nserror create_cache_home(char **cache_home_out) /* strip the trailing separator */ cache_home[strlen(cache_home) - 1] = 0; - LOG("\"%s\"", cache_home); + NSLOG(netsurf, INFO, "\"%s\"", cache_home); *cache_home_out = cache_home; @@ -1115,7 +1119,8 @@ int main(int argc, char** argv) ret = create_config_home(&nsgtk_config_home); } if (ret != NSERROR_OK) { - LOG("Unable to locate a configuration directory."); + NSLOG(netsurf, INFO, + "Unable to locate a configuration directory."); nsgtk_config_home = NULL; } @@ -1155,7 +1160,7 @@ int main(int argc, char** argv) if (ret != NSERROR_OK) { fprintf(stderr, "Unable to load translated messages (%s)\n", messages_get_errorcode(ret)); - LOG("Unable to load translated messages"); + NSLOG(netsurf, INFO, "Unable to load translated messages"); /** \todo decide if message load faliure should be fatal */ } @@ -1166,7 +1171,7 @@ int main(int argc, char** argv) ret = create_cache_home(&cache_home); } if (ret != NSERROR_OK) { - LOG("Unable to locate a cache directory."); + NSLOG(netsurf, INFO, "Unable to locate a cache directory."); } /* core initialisation */ diff --git a/frontends/gtk/hotlist.c b/frontends/gtk/hotlist.c index 936573a0b..843e47736 100644 --- a/frontends/gtk/hotlist.c +++ b/frontends/gtk/hotlist.c @@ -236,8 +236,9 @@ static void nsgtk_hotlist_init_menu(struct nsgtk_hotlist_window *hlwin) w = GTK_WIDGET(gtk_builder_get_object(hlwin->builder, event->widget)); if (w == NULL) { - LOG("Unable to connect menu widget ""%s""", - event->widget); + NSLOG(netsurf, INFO, + "Unable to connect menu widget ""%s""", + event->widget); } else { g_signal_connect(G_OBJECT(w), "activate", @@ -326,7 +327,7 @@ static nserror nsgtk_hotlist_init(void) res = nsgtk_builder_new_from_resname("hotlist", &ncwin->builder); if (res != NSERROR_OK) { - LOG("Hotlist UI builder init failed"); + NSLOG(netsurf, INFO, "Hotlist UI builder init failed"); free(ncwin); return res; } diff --git a/frontends/gtk/layout_pango.c b/frontends/gtk/layout_pango.c index fb065b127..300278648 100644 --- a/frontends/gtk/layout_pango.c +++ b/frontends/gtk/layout_pango.c @@ -42,12 +42,12 @@ static PangoLayout *nsfont_pango_layout = NULL; static inline void nsfont_pango_check(void) { if (nsfont_pango_context == NULL) { - LOG("Creating nsfont_pango_context."); + NSLOG(netsurf, INFO, "Creating nsfont_pango_context."); nsfont_pango_context = gdk_pango_context_get(); } if (nsfont_pango_layout == NULL) { - LOG("Creating nsfont_pango_layout."); + NSLOG(netsurf, INFO, "Creating nsfont_pango_layout."); nsfont_pango_layout = pango_layout_new(nsfont_pango_context); } } diff --git a/frontends/gtk/local_history.c b/frontends/gtk/local_history.c index cc9580130..35b7a4ad6 100644 --- a/frontends/gtk/local_history.c +++ b/frontends/gtk/local_history.c @@ -148,7 +148,7 @@ nsgtk_local_history_init(struct browser_window *bw, res = nsgtk_builder_new_from_resname("localhistory", &ncwin->builder); if (res != NSERROR_OK) { - LOG("Local history UI builder init failed"); + NSLOG(netsurf, INFO, "Local history UI builder init failed"); free(ncwin); return res; } diff --git a/frontends/gtk/login.c b/frontends/gtk/login.c index 3e29903fe..91d8b37f0 100644 --- a/frontends/gtk/login.c +++ b/frontends/gtk/login.c @@ -222,7 +222,7 @@ void gui_401login_open(nsurl *url, res = create_login_window(url, host, realm, cb, cbpw); if (res != NSERROR_OK) { - LOG("Login init failed"); + NSLOG(netsurf, INFO, "Login init failed"); /* creating login failed so cancel navigation */ cb(false, cbpw); diff --git a/frontends/gtk/plotters.c b/frontends/gtk/plotters.c index c57b03294..88e7760c6 100644 --- a/frontends/gtk/plotters.c +++ b/frontends/gtk/plotters.c @@ -413,7 +413,7 @@ nsgtk_plot_path(const struct redraw_context *ctx, return NSERROR_OK; if (p[0] != PLOTTER_PATH_MOVE) { - LOG("Path does not start with move"); + NSLOG(netsurf, INFO, "Path does not start with move"); return NSERROR_INVALID; } @@ -451,7 +451,7 @@ nsgtk_plot_path(const struct redraw_context *ctx, p[i+5], p[i+6]); i += 7; } else { - LOG("bad path command %f", p[i]); + NSLOG(netsurf, INFO, "bad path command %f", p[i]); /* Reset matrix for safety */ cairo_set_matrix(current_cr, &old_ctm); return NSERROR_INVALID; diff --git a/frontends/gtk/preferences.c b/frontends/gtk/preferences.c index e51e77014..65f41ed27 100644 --- a/frontends/gtk/preferences.c +++ b/frontends/gtk/preferences.c @@ -621,7 +621,7 @@ comboboxLanguage_add_from_file(GtkListStore *liststore, gtk_list_store_clear(liststore); - LOG("Used %s for languages", file_location); + NSLOG(netsurf, INFO, "Used %s for languages", file_location); while (fgets(buf, sizeof(buf), fp)) { /* Ignore blank lines */ if (buf[0] == '\0') @@ -668,7 +668,7 @@ nsgtk_preferences_comboboxLanguage_realize(GtkWidget *widget, const char *accept_language; if (priv->content_language == NULL) { - LOG("content language list store unavailable"); + NSLOG(netsurf, INFO, "content language list store unavailable"); return; } @@ -697,7 +697,7 @@ nsgtk_preferences_comboboxLanguage_realize(GtkWidget *widget, } } if (res != NSERROR_OK) { - LOG("error populatiung languages combo"); + NSLOG(netsurf, INFO, "error populatiung languages combo"); } } @@ -989,14 +989,15 @@ GtkWidget* nsgtk_preferences(struct browser_window *bw, GtkWindow *parent) res = nsgtk_builder_new_from_resname("options", &preferences_builder); if (res != NSERROR_OK) { - LOG("Preferences UI builder init failed"); + NSLOG(netsurf, INFO, "Preferences UI builder init failed"); return NULL; } priv->dialog = gtk_builder_get_object(preferences_builder, "dialogPreferences"); if (priv->dialog == NULL) { - LOG("Unable to get object for preferences dialog"); + NSLOG(netsurf, INFO, + "Unable to get object for preferences dialog"); /* release builder as were done with it */ g_object_unref(G_OBJECT(preferences_builder)); return NULL; diff --git a/frontends/gtk/print.c b/frontends/gtk/print.c index 54edeee61..8f71230a6 100644 --- a/frontends/gtk/print.c +++ b/frontends/gtk/print.c @@ -145,8 +145,9 @@ static inline void nsgtk_print_set_dashed(void) static nserror nsgtk_print_plot_clip(const struct redraw_context *ctx, const struct rect *clip) { - LOG("Clipping. x0: %i ;\t y0: %i ;\t x1: %i ;\t y1: %i", - clip->x0, clip->y0, clip->x1, clip->y1); + NSLOG(netsurf, INFO, + "Clipping. x0: %i ;\t y0: %i ;\t x1: %i ;\t y1: %i", clip->x0, + clip->y0, clip->x1, clip->y1); /* Normalize cllipping area - to prevent overflows. * See comment in pdf_plot_fill. */ @@ -324,8 +325,8 @@ nsgtk_print_plot_rectangle(const struct redraw_context *ctx, const plot_style_t *style, const struct rect *rect) { - LOG("x0: %i ;\t y0: %i ;\t x1: %i ;\t y1: %i", - rect->x0, rect->y0, rect->x1, rect->y1); + NSLOG(netsurf, INFO, "x0: %i ;\t y0: %i ;\t x1: %i ;\t y1: %i", + rect->x0, rect->y0, rect->x1, rect->y1); if (style->fill_type != PLOT_OP_TYPE_NONE) { int x0,y0,x1,y1; @@ -395,7 +396,7 @@ nsgtk_print_plot_polygon(const struct redraw_context *ctx, { unsigned int i; - LOG("Plotting polygon."); + NSLOG(netsurf, INFO, "Plotting polygon."); nsgtk_print_set_colour(style->fill_colour); nsgtk_print_set_solid(); @@ -403,11 +404,12 @@ nsgtk_print_plot_polygon(const struct redraw_context *ctx, cairo_set_line_width(gtk_print_current_cr, 0); cairo_move_to(gtk_print_current_cr, p[0], p[1]); - LOG("Starting line at: %i\t%i", p[0], p[1]); + NSLOG(netsurf, INFO, "Starting line at: %i\t%i", p[0], p[1]); for (i = 1; i != n; i++) { cairo_line_to(gtk_print_current_cr, p[i * 2], p[i * 2 + 1]); - LOG("Drawing line to: %i\t%i", p[i * 2], p[i * 2 + 1]); + NSLOG(netsurf, INFO, "Drawing line to: %i\t%i", p[i * 2], + p[i * 2 + 1]); } cairo_fill(gtk_print_current_cr); @@ -700,7 +702,7 @@ void gtk_print_signal_begin_print (GtkPrintOperation *operation, int page_number; double height_on_page, height_to_print; - LOG("Begin print"); + NSLOG(netsurf, INFO, "Begin print"); settings = user_data; @@ -719,7 +721,11 @@ void gtk_print_signal_begin_print (GtkPrintOperation *operation, } else { - LOG("page_width: %f ;page_height: %f; content height: %lf", settings->page_width, settings->page_height, height_to_print); + NSLOG(netsurf, INFO, + "page_width: %f ;page_height: %f; content height: %lf", + settings->page_width, + settings->page_height, + height_to_print); height_on_page = settings->page_height; height_on_page = height_on_page - @@ -743,7 +749,7 @@ void gtk_print_signal_begin_print (GtkPrintOperation *operation, void gtk_print_signal_draw_page(GtkPrintOperation *operation, GtkPrintContext *context, gint page_nr, gpointer user_data) { - LOG("Draw Page"); + NSLOG(netsurf, INFO, "Draw Page"); gtk_print_current_cr = gtk_print_context_get_cairo_context(context); print_draw_next_page(>k_printer, settings); } @@ -755,7 +761,7 @@ void gtk_print_signal_draw_page(GtkPrintOperation *operation, void gtk_print_signal_end_print(GtkPrintOperation *operation, GtkPrintContext *context, gpointer user_data) { - LOG("End print"); + NSLOG(netsurf, INFO, "End print"); print_cleanup(content_to_print, >k_printer, user_data); } diff --git a/frontends/gtk/resources.c b/frontends/gtk/resources.c index 4f9afb034..c07548b01 100644 --- a/frontends/gtk/resources.c +++ b/frontends/gtk/resources.c @@ -198,7 +198,8 @@ init_resource(char **respath, struct nsgtk_resource_s *resource) /* found an entry in the resources */ resource->path = resname; resource->type = NSGTK_RESOURCE_GLIB; - LOG("Found gresource path %s", resource->path); + NSLOG(netsurf, INFO, "Found gresource path %s", + resource->path); return NSERROR_OK; } /*LOG("gresource \"%s\" not found", resname);*/ @@ -221,7 +222,8 @@ init_resource(char **respath, struct nsgtk_resource_s *resource) /* found an entry in the resources */ resource->path = resname; resource->type = NSGTK_RESOURCE_GLIB; - LOG("Found gresource path %s", resource->path); + NSLOG(netsurf, INFO, "Found gresource path %s", + resource->path); return NSERROR_OK; } /*LOG("gresource \"%s\" not found", resname);*/ @@ -231,8 +233,9 @@ init_resource(char **respath, struct nsgtk_resource_s *resource) resname = filepath_find(respath, resource->name); if (resname == NULL) { - LOG("Unable to find resource %s on resource path", - resource->name); + NSLOG(netsurf, INFO, + "Unable to find resource %s on resource path", + resource->name); return NSERROR_NOT_FOUND; } @@ -240,7 +243,7 @@ init_resource(char **respath, struct nsgtk_resource_s *resource) resource->path = resname; resource->type = NSGTK_RESOURCE_FILE; - LOG("Found file resource path %s", resource->path); + NSLOG(netsurf, INFO, "Found file resource path %s", resource->path); return NSERROR_OK; } @@ -295,21 +298,21 @@ init_pixbuf_resource(char **respath, struct nsgtk_resource_s *resource) if (strncmp(resource->name, "menu_cursor.png", resource->len) == 0) { resource->path = (char *)&menu_cursor_pixdata[0]; resource->type = NSGTK_RESOURCE_INLINE; - LOG("Found builtin for %s", resource->name); + NSLOG(netsurf, INFO, "Found builtin for %s", resource->name); return NSERROR_OK; } if (strncmp(resource->name, "netsurf.xpm", resource->len) == 0) { resource->path = (char *)&netsurf_pixdata[0]; resource->type = NSGTK_RESOURCE_INLINE; - LOG("Found builtin for %s", resource->name); + NSLOG(netsurf, INFO, "Found builtin for %s", resource->name); return NSERROR_OK; } if (strncmp(resource->name, "favicon.png", resource->len) == 0) { resource->path = (char *)&favicon_pixdata[0]; resource->type = NSGTK_RESOURCE_INLINE; - LOG("Found builtin for %s", resource->name); + NSLOG(netsurf, INFO, "Found builtin for %s", resource->name); return NSERROR_OK; } #endif @@ -389,13 +392,13 @@ static void list_gresource(void) G_RESOURCE_LOOKUP_FLAGS_NONE, &gerror); if (gerror) { - LOG("gerror %s", gerror->message); + NSLOG(netsurf, INFO, "gerror %s", gerror->message); g_error_free(gerror); } else { cur = reslist; while (cur != NULL && *cur != NULL) { - LOG("gres %s", *cur); + NSLOG(netsurf, INFO, "gres %s", *cur); cur++; } g_strfreev(reslist); @@ -488,12 +491,17 @@ nsgdk_pixbuf_new_from_resname(const char *resname, GdkPixbuf **pixbuf_out) if (new_pixbuf == NULL) { if (error != NULL) { - LOG("Unable to create pixbuf from file for %s with path %s \"%s\"", - resource->name, resource->path, error->message); + NSLOG(netsurf, INFO, + "Unable to create pixbuf from file for %s with path %s \"%s\"", + resource->name, + resource->path, + error->message); g_error_free(error); } else { - LOG("Unable to create pixbuf from file for %s with path %s", - resource->name, resource->path); + NSLOG(netsurf, INFO, + "Unable to create pixbuf from file for %s with path %s", + resource->name, + resource->path); } return NSERROR_INIT_FAILED; } @@ -521,8 +529,11 @@ nsgtk_builder_new_from_resname(const char *resname, GtkBuilder **builder_out) if (!gtk_builder_add_from_file(new_builder, ui_res->path, &error)) { - LOG("Unable to add UI builder from file for %s with path %s \"%s\"", - ui_res->name, ui_res->path, error->message); + NSLOG(netsurf, INFO, + "Unable to add UI builder from file for %s with path %s \"%s\"", + ui_res->name, + ui_res->path, + error->message); g_error_free(error); g_object_unref(G_OBJECT(new_builder)); return NSERROR_INIT_FAILED; @@ -531,8 +542,11 @@ nsgtk_builder_new_from_resname(const char *resname, GtkBuilder **builder_out) if (!nsgtk_builder_add_from_resource(new_builder, ui_res->path, &error)) { - LOG("Unable to add UI builder from resource for %s with path %s \"%s\"", - ui_res->name, ui_res->path, error->message); + NSLOG(netsurf, INFO, + "Unable to add UI builder from resource for %s with path %s \"%s\"", + ui_res->name, + ui_res->path, + error->message); g_error_free(error); g_object_unref(G_OBJECT(new_builder)); return NSERROR_INIT_FAILED; diff --git a/frontends/gtk/scaffolding.c b/frontends/gtk/scaffolding.c index 25f36c5d3..cbc46cbc5 100644 --- a/frontends/gtk/scaffolding.c +++ b/frontends/gtk/scaffolding.c @@ -269,7 +269,7 @@ static void scaffolding_window_destroy(GtkWidget *widget, gpointer data) { struct nsgtk_scaffolding *gs = data; - LOG("scaffold:%p", gs); + NSLOG(netsurf, INFO, "scaffold:%p", gs); nsgtk_local_history_hide(); @@ -282,7 +282,7 @@ static void scaffolding_window_destroy(GtkWidget *widget, gpointer data) gs->next->prev = gs->prev; } - LOG("scaffold list head: %p", scaf_list); + NSLOG(netsurf, INFO, "scaffold list head: %p", scaf_list); if (scaf_list == NULL) { /* no more open windows - stop the browser */ @@ -805,7 +805,10 @@ MULTIHANDLER(savepage) path = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(fc)); d = opendir(path); if (d == NULL) { - LOG("Unable to open directory %s for complete save: %s", path, strerror(errno)); + NSLOG(netsurf, INFO, + "Unable to open directory %s for complete save: %s", + path, + strerror(errno)); if (errno == ENOTDIR) nsgtk_warning("NoDirError", path); else @@ -837,7 +840,7 @@ MULTIHANDLER(pdf) char *url_name; nserror res; - LOG("Print preview (generating PDF) started."); + NSLOG(netsurf, INFO, "Print preview (generating PDF) started."); res = nsurl_nice(browser_window_get_url(bw), &url_name, true); if (res != NSERROR_OK) { @@ -1221,10 +1224,10 @@ MULTIHANDLER(selectall) struct browser_window *bw = nsgtk_get_browser_window(g->top_level); if (nsgtk_widget_has_focus(GTK_WIDGET(g->url_bar))) { - LOG("Selecting all URL bar text"); + NSLOG(netsurf, INFO, "Selecting all URL bar text"); gtk_editable_select_region(GTK_EDITABLE(g->url_bar), 0, -1); } else { - LOG("Selecting all document text"); + NSLOG(netsurf, INFO, "Selecting all document text"); browser_window_key_press(bw, NS_KEY_SELECT_ALL); } @@ -1590,7 +1593,8 @@ MULTIHANDLER(localhistory) res = nsgtk_local_history_present(g->window, bw); if (res != NSERROR_OK) { - LOG("Unable to initialise local history window."); + NSLOG(netsurf, INFO, + "Unable to initialise local history window."); } return TRUE; } @@ -1600,7 +1604,8 @@ MULTIHANDLER(globalhistory) nserror res; res = nsgtk_global_history_present(); if (res != NSERROR_OK) { - LOG("Unable to initialise global history window."); + NSLOG(netsurf, INFO, + "Unable to initialise global history window."); } return TRUE; } @@ -1620,7 +1625,7 @@ MULTIHANDLER(showbookmarks) nserror res; res = nsgtk_hotlist_present(); if (res != NSERROR_OK) { - LOG("Unable to initialise bookmark window."); + NSLOG(netsurf, INFO, "Unable to initialise bookmark window."); } return TRUE; } @@ -1630,7 +1635,7 @@ MULTIHANDLER(showcookies) nserror res; res = nsgtk_cookies_present(); if (res != NSERROR_OK) { - LOG("Unable to initialise cookies window."); + NSLOG(netsurf, INFO, "Unable to initialise cookies window."); } return TRUE; } @@ -2073,7 +2078,8 @@ struct nsgtk_scaffolding *nsgtk_new_scaffolding(struct gui_window *toplevel) return NULL; } - LOG("Constructing a scaffold of %p for gui_window %p", gs, toplevel); + NSLOG(netsurf, INFO, + "Constructing a scaffold of %p for gui_window %p", gs, toplevel); gs->top_level = toplevel; @@ -2278,7 +2284,7 @@ struct nsgtk_scaffolding *nsgtk_new_scaffolding(struct gui_window *toplevel) /* finally, show the window. */ gtk_widget_show(GTK_WIDGET(gs->window)); - LOG("creation complete"); + NSLOG(netsurf, INFO, "creation complete"); return gs; } @@ -2466,7 +2472,8 @@ gui_search_web_provider_update(const char *provider_name, GdkPixbuf *srch_pixbuf = NULL; char *searchcontent; - LOG("name:%s bitmap %p", provider_name, provider_bitmap); + NSLOG(netsurf, INFO, "name:%s bitmap %p", provider_name, + provider_bitmap); if (provider_bitmap != NULL) { srch_pixbuf = nsgdk_pixbuf_get_from_surface(provider_bitmap->surface, 16, 16); diff --git a/frontends/gtk/schedule.c b/frontends/gtk/schedule.c index cf0333388..201432097 100644 --- a/frontends/gtk/schedule.c +++ b/frontends/gtk/schedule.c @@ -21,14 +21,10 @@ #include #include "utils/errors.h" +#include "utils/log.h" #include "gtk/schedule.h" -#ifdef DEBUG_GTK_SCHEDULE -#include "utils/log.h" -#else -#define LOG(format, args...) ((void) 0) -#endif /** Killable callback closure embodiment. */ typedef struct { @@ -50,7 +46,7 @@ nsgtk_schedule_generic_callback(gpointer data) _nsgtk_callback_t *cb = (_nsgtk_callback_t *)(data); if (cb->callback_killed) { /* This callback instance has been killed. */ - LOG("CB at %p already dead.", cb); + NSLOG(netsurf, DEBUG, "CB at %p already dead.", cb); } queued_callbacks = g_list_remove(queued_callbacks, cb); pending_callbacks = g_list_append(pending_callbacks, cb); @@ -64,7 +60,8 @@ nsgtk_schedule_kill_callback(void *_target, void *_match) _nsgtk_callback_t *match = (_nsgtk_callback_t *)_match; if ((target->callback == match->callback) && (target->context == match->context)) { - LOG("Found match for %p(%p), killing.", target->callback, target->context); + NSLOG(netsurf, DEBUG, "Found match for %p(%p), killing.", + target->callback, target->context); target->callback = NULL; target->context = NULL; target->callback_killed = true; @@ -122,7 +119,8 @@ schedule_run(void) /* Clear the pending list. */ pending_callbacks = NULL; - LOG("Captured a run of %d callbacks to fire.", g_list_length(this_run)); + NSLOG(netsurf, DEBUG, "Captured a run of %d callbacks to fire.", + g_list_length(this_run)); /* Run all the callbacks which made it this far. */ while (this_run != NULL) { diff --git a/frontends/gtk/ssl_cert.c b/frontends/gtk/ssl_cert.c index 5388f0194..9d98db1f6 100644 --- a/frontends/gtk/ssl_cert.c +++ b/frontends/gtk/ssl_cert.c @@ -183,7 +183,7 @@ nserror gtk_cert_verify(struct nsurl *url, res = nsgtk_builder_new_from_resname("ssl", &ncwin->builder); if (res != NSERROR_OK) { - LOG("SSL UI builder init failed"); + NSLOG(netsurf, INFO, "SSL UI builder init failed"); free(ncwin); return res; } diff --git a/frontends/gtk/tabs.c b/frontends/gtk/tabs.c index 6adce3a06..dbe9d405b 100644 --- a/frontends/gtk/tabs.c +++ b/frontends/gtk/tabs.c @@ -147,18 +147,20 @@ nsgtk_tab_switch_page_after(GtkNotebook *notebook, if ((srcpagenum != -1) && (srcpagenum != (gint)selpagenum)) { /* ensure the add tab is not actually selected */ - LOG("src %d sel %d", srcpagenum, selpagenum); + NSLOG(netsurf, INFO, "src %d sel %d", srcpagenum, + selpagenum); srcpage = gtk_notebook_get_nth_page(notebook, srcpagenum); gw = g_object_get_data(G_OBJECT(srcpage), "gui_window"); if ((gw != NULL) && (nsgtk_get_scaffold(gw) != NULL)) { error = nsgtk_scaffolding_new_tab(gw); if (error != NSERROR_OK) { - LOG("Failed to open new tab."); + NSLOG(netsurf, INFO, + "Failed to open new tab."); } } } } else { - LOG("sel %d", selpagenum); + NSLOG(netsurf, INFO, "sel %d", selpagenum); /* tab with page in it */ gw = g_object_get_data(G_OBJECT(selpage), "gui_window"); if (gw != NULL) { diff --git a/frontends/gtk/throbber.c b/frontends/gtk/throbber.c index 9392c3909..b8efceca1 100644 --- a/frontends/gtk/throbber.c +++ b/frontends/gtk/throbber.c @@ -59,12 +59,14 @@ nserror nsgtk_throbber_init(void) if (res != NSERROR_OK) { break; } - LOG("%s",resname); + NSLOG(netsurf, INFO, "%s", resname); } if (frame < 1) { /* we need at least two frames - one for idle, one for active */ - LOG("Insufficent number of frames (%d) in throbber animation.", frame); + NSLOG(netsurf, INFO, + "Insufficent number of frames (%d) in throbber animation.", + frame); res = NSERROR_INIT_FAILED; } diff --git a/frontends/gtk/toolbar.c b/frontends/gtk/toolbar.c index 1f8dbbb7c..0ca26c92d 100644 --- a/frontends/gtk/toolbar.c +++ b/frontends/gtk/toolbar.c @@ -971,7 +971,8 @@ static nserror nsgtk_toolbar_customization_save(struct nsgtk_scaffolding *g) nsgtk_scaffolding_button(g, tbidx)->location); if (plen == order_len) { /* ran out of space, bail early */ - LOG("toolbar ordering exceeded available space"); + NSLOG(netsurf, INFO, + "toolbar ordering exceeded available space"); break; } cur += plen; @@ -1110,7 +1111,7 @@ static void nsgtk_toolbar_window_open(struct nsgtk_scaffolding *g) res = nsgtk_builder_new_from_resname("toolbar", &window->builder); if (res != NSERROR_OK) { - LOG("Toolbar UI builder init failed"); + NSLOG(netsurf, INFO, "Toolbar UI builder init failed"); nsgtk_warning(messages_get("NoMemory"), 0); nsgtk_toolbar_cancel_clicked(NULL, g); free(theme); diff --git a/frontends/gtk/viewdata.c b/frontends/gtk/viewdata.c index 6ed9dd9ac..d633238d0 100644 --- a/frontends/gtk/viewdata.c +++ b/frontends/gtk/viewdata.c @@ -371,7 +371,7 @@ window_init(const char *title, res = nsgtk_builder_new_from_resname("viewdata", &newctx->builder); if (res != NSERROR_OK) { - LOG("Viewdata UI builder init failed"); + NSLOG(netsurf, INFO, "Viewdata UI builder init failed"); free(newctx); return res; } @@ -381,7 +381,7 @@ window_init(const char *title, window = GTK_WINDOW(gtk_builder_get_object(newctx->builder, "ViewDataWindow")); if (window == NULL) { - LOG("Unable to find window in builder "); + NSLOG(netsurf, INFO, "Unable to find window in builder "); /* free the builder */ g_object_unref(G_OBJECT(newctx->builder)); @@ -616,7 +616,7 @@ static char** xdg_data_strvec(void) xdg_data_home, xdg_data_dirs); } - LOG("%s", xdg_data_path); + NSLOG(netsurf, INFO, "%s", xdg_data_path); svec = filepath_path_to_strvec(xdg_data_path); free(xdg_data_path); @@ -651,7 +651,7 @@ static char *xdg_get_default_app(const char *path, const char *mimetype) fname = malloc(fname_len); snprintf(fname, fname_len, "%s/applications/defaults.list", path); - LOG("Checking %s", fname); + NSLOG(netsurf, INFO, "Checking %s", fname); fp = fopen(fname, "r"); free(fname); @@ -674,8 +674,11 @@ static char *xdg_get_default_app(const char *path, const char *mimetype) ret = strdup(line + mimetype_len + 1); - LOG("Found line match for %s length %zu\n", mimetype, rd); - LOG("Result %s", ret); + NSLOG(netsurf, INFO, + "Found line match for %s length %zu\n", + mimetype, + rd); + NSLOG(netsurf, INFO, "Result %s", ret); break; } @@ -714,7 +717,7 @@ static char *xdg_get_exec_cmd(const char *path, const char *desktop) fname = malloc(fname_len); snprintf(fname, fname_len, "%s/applications/%s", path, desktop); - LOG("Checking %s", fname); + NSLOG(netsurf, INFO, "Checking %s", fname); fp = fopen(fname, "r"); free(fname); @@ -735,8 +738,8 @@ static char *xdg_get_exec_cmd(const char *path, const char *desktop) ret = strdup(line + SLEN("Exec=")); - LOG("Found Exec length %zu", rd); - LOG("Result %s", ret); + NSLOG(netsurf, INFO, "Found Exec length %zu", rd); + NSLOG(netsurf, INFO, "Result %s", ret); break; } @@ -801,7 +804,7 @@ static char **build_exec_argv(const char *fname, const char *exec_cmd) argv[aidx] = exec_arg(start, cur - start, fname); if (argv[aidx] != NULL) { - LOG("adding \"%s\"", argv[aidx]); + NSLOG(netsurf, INFO, "adding \"%s\"", argv[aidx]); aidx++; } } diff --git a/frontends/gtk/window.c b/frontends/gtk/window.c index d32f4573a..7f24d40ac 100644 --- a/frontends/gtk/window.c +++ b/frontends/gtk/window.c @@ -458,7 +458,7 @@ nsgtk_window_scroll_event(GtkWidget *widget, break; #endif default: - LOG("Unhandled mouse scroll direction"); + NSLOG(netsurf, INFO, "Unhandled mouse scroll direction"); return TRUE; } @@ -741,7 +741,7 @@ gui_window_create(struct browser_window *bw, res = nsgtk_builder_new_from_resname("tabcontents", &tab_builder); if (res != NSERROR_OK) { - LOG("Tab contents UI builder init failed"); + NSLOG(netsurf, INFO, "Tab contents UI builder init failed"); return NULL; } @@ -754,7 +754,8 @@ gui_window_create(struct browser_window *bw, return NULL; } - LOG("Creating gui window %p for browser window %p", g, bw); + NSLOG(netsurf, INFO, "Creating gui window %p for browser window %p", + g, bw); g->bw = bw; g->mouse.state = 0; @@ -903,10 +904,10 @@ void nsgtk_window_destroy_browser(struct gui_window *gw) static void gui_window_destroy(struct gui_window *g) { - LOG("gui_window: %p", g); + NSLOG(netsurf, INFO, "gui_window: %p", g); assert(g != NULL); assert(g->bw != NULL); - LOG("scaffolding: %p", g->scaffold); + NSLOG(netsurf, INFO, "scaffolding: %p", g->scaffold); if (g->prev) { g->prev->next = g->next; @@ -918,7 +919,7 @@ static void gui_window_destroy(struct gui_window *g) g->next->prev = g->prev; } - LOG("window list head: %p", window_list); + NSLOG(netsurf, INFO, "window list head: %p", window_list); } /** @@ -940,13 +941,13 @@ static void gui_window_set_icon(struct gui_window *gw, struct hlcache_handle *ic if (icon != NULL) { icon_bitmap = content_get_bitmap(icon); if (icon_bitmap != NULL) { - LOG("Using %p bitmap", icon_bitmap); + NSLOG(netsurf, INFO, "Using %p bitmap", icon_bitmap); gw->icon = nsgdk_pixbuf_get_from_surface(icon_bitmap->surface, 16, 16); } } if (gw->icon == NULL) { - LOG("Using default favicon"); + NSLOG(netsurf, INFO, "Using default favicon"); g_object_ref(favicon_pixbuf); gw->icon = favicon_pixbuf; } @@ -1236,7 +1237,7 @@ gui_window_get_dimensions(struct gui_window *gw, *width /= scale; *height /= scale; } - LOG("gw:%p width:%i height:%i", gw, *width, *height); + NSLOG(netsurf, INFO, "gw:%p width:%i height:%i", gw, *width, *height); return NSERROR_OK; } @@ -1269,8 +1270,8 @@ static void gui_window_create_form_select_menu(struct gui_window *g, item = 0; option = form_select_get_option(control, item); while (option != NULL) { - LOG("Item %"PRIdPTR" option %p text %s", - item, option, option->text); + NSLOG(netsurf, INFO, "Item %"PRIdPTR" option %p text %s", + item, option, option->text); menu_item = gtk_check_menu_item_new_with_label(option->text); if (option->selected) { gtk_check_menu_item_set_active( @@ -1313,10 +1314,10 @@ gui_window_file_gadget_open(struct gui_window *g, NSGTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT, NULL); - LOG("*** open dialog: %p", dialog); + NSLOG(netsurf, INFO, "*** open dialog: %p", dialog); int ret = gtk_dialog_run(GTK_DIALOG(dialog)); - LOG("*** return value: %d", ret); + NSLOG(netsurf, INFO, "*** return value: %d", ret); if (ret == GTK_RESPONSE_ACCEPT) { char *filename; diff --git a/frontends/monkey/browser.c b/frontends/monkey/browser.c index 16d33010d..1fbbbf0b1 100644 --- a/frontends/monkey/browser.c +++ b/frontends/monkey/browser.c @@ -471,7 +471,7 @@ monkey_window_handle_redraw(int argc, char **argv) clip.y1 = atoi(argv[6]); } - LOG("Issue redraw"); + NSLOG(netsurf, INFO, "Issue redraw"); fprintf(stdout, "WINDOW REDRAW WIN %d START\n", atoi(argv[2])); browser_window_redraw(gw->bw, gw->scrollx, gw->scrolly, &clip, &ctx); fprintf(stdout, "WINDOW REDRAW WIN %d STOP\n", atoi(argv[2])); diff --git a/frontends/monkey/dispatch.c b/frontends/monkey/dispatch.c index b531f05f9..e60325cf1 100644 --- a/frontends/monkey/dispatch.c +++ b/frontends/monkey/dispatch.c @@ -40,7 +40,7 @@ monkey_register_handler(const char *cmd, handle_command_fn fn) { monkey_cmdhandler_t *ret = calloc(sizeof(*ret), 1); if (ret == NULL) { - LOG("Unable to allocate handler"); + NSLOG(netsurf, INFO, "Unable to allocate handler"); return NSERROR_NOMEM; } ret->cmd = strdup(cmd); diff --git a/frontends/monkey/filetype.c b/frontends/monkey/filetype.c index 20bd1edad..979796baf 100644 --- a/frontends/monkey/filetype.c +++ b/frontends/monkey/filetype.c @@ -85,7 +85,8 @@ void monkey_fetch_filetype_init(const char *mimefile) fh = fopen(mimefile, "r"); if (fh == NULL) { - LOG("Unable to open a mime.types file, so using a minimal one for you."); + NSLOG(netsurf, INFO, + "Unable to open a mime.types file, so using a minimal one for you."); return; } diff --git a/frontends/monkey/main.c b/frontends/monkey/main.c index 1bea02471..d697f271f 100644 --- a/frontends/monkey/main.c +++ b/frontends/monkey/main.c @@ -278,20 +278,20 @@ static void monkey_run(void) /* setup timeout */ switch (schedtm) { case -1: - LOG("Iterate blocking"); + NSLOG(netsurf, INFO, "Iterate blocking"); fprintf(stdout, "GENERIC POLL BLOCKING\n"); timeout = NULL; break; case 0: - LOG("Iterate immediate"); + NSLOG(netsurf, INFO, "Iterate immediate"); tv.tv_sec = 0; tv.tv_usec = 0; timeout = &tv; break; default: - LOG("Iterate non-blocking"); + NSLOG(netsurf, INFO, "Iterate non-blocking"); fprintf(stdout, "GENERIC POLL TIMED %d\n", schedtm); tv.tv_sec = schedtm / 1000; /* miliseconds to seconds */ tv.tv_usec = (schedtm % 1000) * 1000; /* remainder to microseconds */ @@ -361,7 +361,7 @@ main(int argc, char **argv) messages = filepath_find(respaths, "Messages"); ret = messages_add_from_file(messages); if (ret != NSERROR_OK) { - LOG("Messages failed to load"); + NSLOG(netsurf, INFO, "Messages failed to load"); } /* common initialisation */ diff --git a/frontends/monkey/schedule.c b/frontends/monkey/schedule.c index af1144a0e..b34bd5aa5 100644 --- a/frontends/monkey/schedule.c +++ b/frontends/monkey/schedule.c @@ -204,13 +204,14 @@ void monkey_schedule_list(void) gettimeofday(&tv, NULL); - LOG("schedule list at %lld:%ld", (long long)tv.tv_sec, tv.tv_usec); + NSLOG(netsurf, INFO, "schedule list at %lld:%ld", + (long long)tv.tv_sec, tv.tv_usec); cur_nscb = schedule_list; while (cur_nscb != NULL) { - LOG("Schedule %p at %lld:%ld", - cur_nscb, (long long)cur_nscb->tv.tv_sec, cur_nscb->tv.tv_usec); + NSLOG(netsurf, INFO, "Schedule %p at %lld:%ld", cur_nscb, + (long long)cur_nscb->tv.tv_sec, cur_nscb->tv.tv_usec); cur_nscb = cur_nscb->next; } } diff --git a/frontends/riscos/401login.c b/frontends/riscos/401login.c index a23c01c90..4b2deb16b 100644 --- a/frontends/riscos/401login.c +++ b/frontends/riscos/401login.c @@ -191,7 +191,8 @@ void ro_gui_401login_close(wimp_w w) error = xwimp_delete_window(w); if (error) { - LOG("xwimp_delete_window: 0x%x:%s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_delete_window: 0x%x:%s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); } ro_gui_wimp_event_finalise(w); @@ -212,7 +213,7 @@ bool ro_gui_401login_apply(wimp_w w) auth = malloc(strlen(session->uname) + strlen(session->pwd) + 2); if (!auth) { - LOG("calloc failed"); + NSLOG(netsurf, INFO, "calloc failed"); ro_warn_user("NoMemory", 0); return false; } diff --git a/frontends/riscos/bitmap.c b/frontends/riscos/bitmap.c index 1a3524633..d554d54b4 100644 --- a/frontends/riscos/bitmap.c +++ b/frontends/riscos/bitmap.c @@ -287,7 +287,10 @@ bool riscos_bitmap_save(void *vbitmap, const char *path, unsigned flags) error = xosspriteop_save_sprite_file(osspriteop_USER_AREA, (bitmap->sprite_area), path); if (error) { - LOG("xosspriteop_save_sprite_file: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, + "xosspriteop_save_sprite_file: 0x%x: %s", + error->errnum, + error->errmess); ro_warn_user("SaveError", error->errmess); return false; } @@ -347,7 +350,8 @@ bool riscos_bitmap_save(void *vbitmap, const char *path, unsigned flags) error = xosfind_openoutw(0, path, NULL, &fw); if (error) { - LOG("xosfind_openoutw: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xosfind_openoutw: 0x%x: %s", + error->errnum, error->errmess); free(chunk_buf); ro_warn_user("SaveError", error->errmess); return false; @@ -361,7 +365,8 @@ bool riscos_bitmap_save(void *vbitmap, const char *path, unsigned flags) if (!error) error = xosgbpb_writew(fw, (byte*)p, image_size, NULL); if (error) { - LOG("xosgbpb_writew: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xosgbpb_writew: 0x%x: %s", + error->errnum, error->errmess); free(chunk_buf); xosfind_closew(fw); ro_warn_user("SaveError", error->errmess); @@ -406,7 +411,10 @@ bool riscos_bitmap_save(void *vbitmap, const char *path, unsigned flags) } error = xosgbpb_writew(fw, (byte*)chunk_buf, dp-chunk_buf, NULL); if (error) { - LOG("xosgbpb_writew: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, + "xosgbpb_writew: 0x%x: %s", + error->errnum, + error->errmess); free(chunk_buf); xosfind_closew(fw); ro_warn_user("SaveError", error->errmess); @@ -416,13 +424,15 @@ bool riscos_bitmap_save(void *vbitmap, const char *path, unsigned flags) error = xosfind_closew(fw); if (error) { - LOG("xosfind_closew: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xosfind_closew: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("SaveError", error->errmess); } error = xosfile_set_type(path, osfile_TYPE_SPRITE); if (error) { - LOG("xosfile_set_type: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xosfile_set_type: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("SaveError", error->errmess); } @@ -509,7 +519,8 @@ void riscos_bitmap_overlay_sprite(struct bitmap *bitmap, (osspriteop_id)s, &w, &h, NULL, NULL); if (error) { - LOG("xosspriteop_read_sprite_info: 0x%x:%s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xosspriteop_read_sprite_info: 0x%x:%s", + error->errnum, error->errmess); return; } sp_offset = ((s->width + 1) * 4) - w; @@ -591,7 +602,7 @@ static osspriteop_area *thumbnail_create_8bpp(struct bitmap *bitmap) sprite_area = (osspriteop_area *)malloc(area_size); if (!sprite_area) { - LOG("no memory for malloc()"); + NSLOG(netsurf, INFO, "no memory for malloc()"); return NULL; } sprite_area->size = area_size; @@ -759,7 +770,8 @@ static void thumbnail_test(void) area_size = sizeof(osspriteop_area) + sizeof(osspriteop_header) + sizeof(int); if ((sprite_area = (osspriteop_area *)malloc(area_size)) == NULL) { - LOG("Insufficient memory to perform sprite test."); + NSLOG(netsurf, INFO, + "Insufficient memory to perform sprite test."); return; } sprite_area->size = area_size + 1; @@ -791,7 +803,7 @@ nserror riscos_bitmap_render(struct bitmap *bitmap, assert(content); assert(bitmap); - LOG("content %p in bitmap %p", content, bitmap); + NSLOG(netsurf, INFO, "content %p in bitmap %p", content, bitmap); /* check if we have access to 32bpp sprites natively */ if (thumbnail_32bpp_available == -1) { diff --git a/frontends/riscos/buffer.c b/frontends/riscos/buffer.c index 7176c1c1c..c63a270db 100644 --- a/frontends/riscos/buffer.c +++ b/frontends/riscos/buffer.c @@ -107,7 +107,12 @@ void ro_gui_buffer_open(wimp_draw *redraw) */ if ((clipping.x1 < clipping.x0) || (clipping.y1 < clipping.y0)) { - LOG("Invalid clipping rectangle (%i, %i) to (%i,%i)", clipping.x0, clipping.y0, clipping.x1, clipping.y1); + NSLOG(netsurf, INFO, + "Invalid clipping rectangle (%i, %i) to (%i,%i)", + clipping.x0, + clipping.y0, + clipping.x1, + clipping.y1); return; } @@ -138,7 +143,7 @@ void ro_gui_buffer_open(wimp_draw *redraw) (word_width * sprite_size.y * 4) + palette_size; buffer = (osspriteop_area *)malloc(total_size); if (!buffer) { - LOG("Failed to allocate memory"); + NSLOG(netsurf, INFO, "Failed to allocate memory"); ro_gui_buffer_free(); return; } @@ -149,7 +154,8 @@ void ro_gui_buffer_open(wimp_draw *redraw) mode = tinct_SPRITE_MODE; #else if ((error = xwimpreadsysinfo_wimp_mode(&mode)) != NULL) { - LOG("Error reading mode '%s'", error->errmess); + NSLOG(netsurf, INFO, "Error reading mode '%s'", + error->errmess); ro_gui_buffer_free(); return; } @@ -177,7 +183,9 @@ void ro_gui_buffer_open(wimp_draw *redraw) error = xos_read_vdu_variables(PTR_OS_VDU_VAR_LIST(&vars), (int *)&vals); if (error) { - LOG("Error reading mode properties '%s'", error->errmess); + NSLOG(netsurf, INFO, + "Error reading mode properties '%s'", + error->errmess); ro_gui_buffer_free(); return; } @@ -233,7 +241,9 @@ void ro_gui_buffer_open(wimp_draw *redraw) } break; default: - LOG("Unhandled 16bpp format from flags %d", vals.flags); + NSLOG(netsurf, INFO, + "Unhandled 16bpp format from flags %d", + vals.flags); ro_gui_buffer_free(); return; } @@ -261,13 +271,16 @@ void ro_gui_buffer_open(wimp_draw *redraw) } break; default: - LOG("Unhandled 32bpp data format from flags %d", vals.flags); + NSLOG(netsurf, INFO, + "Unhandled 32bpp data format from flags %d", + vals.flags); ro_gui_buffer_free(); return; } break; default: - LOG("Unhandled NCOLOUR value %d", vals.ncolour); + NSLOG(netsurf, INFO, "Unhandled NCOLOUR value %d", + vals.ncolour); ro_gui_buffer_free(); return; } @@ -305,7 +318,7 @@ void ro_gui_buffer_open(wimp_draw *redraw) buffer, buffer_name, palette, clipping.x0, clipping.y0, clipping.x1, clipping.y1)) != NULL) { - LOG("Grab error '%s'", error->errmess); + NSLOG(netsurf, INFO, "Grab error '%s'", error->errmess); ro_gui_buffer_free(); return; } @@ -314,7 +327,7 @@ void ro_gui_buffer_open(wimp_draw *redraw) */ if ((error = xosspriteop_read_save_area_size(osspriteop_PTR, buffer, (osspriteop_id)(buffer + 1), &size)) != NULL) { - LOG("Save area error '%s'", error->errmess); + NSLOG(netsurf, INFO, "Save area error '%s'", error->errmess); ro_gui_buffer_free(); return; } @@ -329,7 +342,7 @@ void ro_gui_buffer_open(wimp_draw *redraw) if ((error = xosspriteop_switch_output_to_sprite(osspriteop_PTR, buffer, (osspriteop_id)(buffer + 1), save_area, &context0, &context1, &context2, &context3)) != NULL) { - LOG("Switching error '%s'", error->errmess); + NSLOG(netsurf, INFO, "Switching error '%s'", error->errmess); free(save_area); ro_gui_buffer_free(); return; @@ -345,7 +358,8 @@ void ro_gui_buffer_open(wimp_draw *redraw) */ if ((error = xos_set_ecf_origin(-ro_plot_origin_x, -ro_plot_origin_y)) != NULL) { - LOG("Invalid ECF origin: '%s'", error->errmess); + NSLOG(netsurf, INFO, "Invalid ECF origin: '%s'", + error->errmess); } } diff --git a/frontends/riscos/configure.c b/frontends/riscos/configure.c index 9d28616ec..f4dced55b 100644 --- a/frontends/riscos/configure.c +++ b/frontends/riscos/configure.c @@ -212,7 +212,10 @@ void ro_gui_configure_open_window(wimp_open *open) y + configure_icon_height - CONFIGURE_ICON_PADDING_V); if (error) { - LOG("xwimp_resize_icon: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, + "xwimp_resize_icon: 0x%x: %s", + error->errnum, + error->errmess); } x += configure_icon_width; l++; @@ -225,7 +228,8 @@ void ro_gui_configure_open_window(wimp_open *open) error = xwimp_force_redraw(configure_window, 0, -16384, 16384, 0); if (error) { - LOG("xwimp_force_redraw: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_force_redraw: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); } } @@ -248,7 +252,8 @@ void ro_gui_configure_open_window(wimp_open *open) extent.y0 = -max_height; error = xwimp_set_extent(open->w, &extent); if (error) { - LOG("xwimp_set_extent: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_set_extent: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); return; } @@ -259,7 +264,8 @@ void ro_gui_configure_open_window(wimp_open *open) /* open the window */ error = xwimp_open_window(open); if (error) { - LOG("xwimp_open_window: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_open_window: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); return; } @@ -276,7 +282,7 @@ void ro_gui_configure_register(const char *window, /* create our tool */ tool = calloc(sizeof(struct configure_tool), 1); if (!tool) { - LOG("Insufficient memory for calloc()"); + NSLOG(netsurf, INFO, "Insufficient memory for calloc()"); die("Insufficient memory"); return; /* For the benefit of scan-build */ } @@ -284,7 +290,7 @@ void ro_gui_configure_register(const char *window, tool->translated[0] = '\0'; tool->validation = malloc(strlen(window) + 2); if (!tool->validation) { - LOG("Insufficient memory for malloc()"); + NSLOG(netsurf, INFO, "Insufficient memory for malloc()"); die("Insufficient memory"); } sprintf(tool->validation, "S%s", window); @@ -311,7 +317,8 @@ void ro_gui_configure_register(const char *window, CONFIGURE_TOOL_TRANSLATED_SIZE; error = xwimp_create_icon(&new_icon, &tool->i); if (error) { - LOG("xwimp_create_icon: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_create_icon: 0x%x: %s", + error->errnum, error->errmess); die(error->errmess); } @@ -360,7 +367,8 @@ bool ro_gui_configure_translate(void) error = xosbyte1(osbyte_ALPHABET_NUMBER, 127, 0, &alphabet); if (error) { - LOG("failed reading alphabet: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "failed reading alphabet: 0x%x: %s", + error->errnum, error->errmess); /* assume Latin1 */ alphabet = territory_ALPHABET_LATIN1; } @@ -381,7 +389,10 @@ bool ro_gui_configure_translate(void) error = xwimptextop_string_width(tool->translated, strlen(tool->translated), &icon_width); if (error) { - LOG("xwimptextop_string_width: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, + "xwimptextop_string_width: 0x%x: %s", + error->errnum, + error->errmess); return false; } icon_width += CONFIGURE_ICON_PADDING_H; @@ -395,7 +406,8 @@ bool ro_gui_configure_translate(void) configure_icon_width, 0); if (error) { - LOG("xwimp_resize_icon: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_resize_icon: 0x%x: %s", + error->errnum, error->errmess); } } diff --git a/frontends/riscos/configure/con_language.c b/frontends/riscos/configure/con_language.c index 2030c65c0..77e4f6cb4 100644 --- a/frontends/riscos/configure/con_language.c +++ b/frontends/riscos/configure/con_language.c @@ -98,7 +98,8 @@ bool ro_gui_options_language_ok(wimp_w w) if (temp) { nsoption_set_charp(language, temp); } else { - LOG("No memory to duplicate language code"); + NSLOG(netsurf, INFO, + "No memory to duplicate language code"); ro_warn_user("NoMemory", 0); } } @@ -113,7 +114,8 @@ bool ro_gui_options_language_ok(wimp_w w) if (temp) { nsoption_set_charp(accept_language,temp); } else { - LOG("No memory to duplicate language code"); + NSLOG(netsurf, INFO, + "No memory to duplicate language code"); ro_warn_user("NoMemory", 0); } } diff --git a/frontends/riscos/configure/con_theme.c b/frontends/riscos/configure/con_theme.c index fb0d3dfb0..28195dea9 100644 --- a/frontends/riscos/configure/con_theme.c +++ b/frontends/riscos/configure/con_theme.c @@ -104,20 +104,23 @@ bool ro_gui_options_theme_initialise(wimp_w w) return false; error = xwimp_create_window(&theme_pane_definition, &theme_pane); if (error) { - LOG("xwimp_create_window: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_create_window: 0x%x: %s", + error->errnum, error->errmess); return false; } state.w = w; error = xwimp_get_window_state(&state); if (error) { - LOG("xwimp_get_window_state: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_get_window_state: 0x%x: %s", + error->errnum, error->errmess); return false; } icon_state.w = w; icon_state.i = THEME_PANE_AREA; error = xwimp_get_icon_state(&icon_state); if (error) { - LOG("xwimp_get_icon_state: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_get_icon_state: 0x%x: %s", + error->errnum, error->errmess); return false; } state.w = theme_pane; @@ -126,7 +129,8 @@ bool ro_gui_options_theme_initialise(wimp_w w) state.visible.x0 += icon_state.icon.extent.x0 + 16; state.visible.y0 = state.visible.y1 + icon_state.icon.extent.y0 + 16; state.visible.y1 += icon_state.icon.extent.y1 - 28; - LOG("Y0 = %i, y1 = %i", icon_state.icon.extent.y0, icon_state.icon.extent.y1); + NSLOG(netsurf, INFO, "Y0 = %i, y1 = %i", icon_state.icon.extent.y0, + icon_state.icon.extent.y1); error = xwimp_open_window_nested(PTR_WIMP_OPEN(&state), w, wimp_CHILD_LINKS_PARENT_VISIBLE_BOTTOM_OR_LEFT << wimp_CHILD_XORIGIN_SHIFT | @@ -141,7 +145,8 @@ bool ro_gui_options_theme_initialise(wimp_w w) wimp_CHILD_LINKS_PARENT_VISIBLE_TOP_OR_RIGHT << wimp_CHILD_TS_EDGE_SHIFT); if (error) { - LOG("xwimp_open_window_nested: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_open_window_nested: 0x%x: %s", + error->errnum, error->errmess); return false; } @@ -176,7 +181,8 @@ void ro_gui_options_theme_finalise(wimp_w w) ro_gui_wimp_event_finalise(theme_pane); error = xwimp_delete_window(theme_pane); if (error) { - LOG("xwimp_delete_window: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_delete_window: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); } theme_pane = 0; @@ -269,7 +275,7 @@ void ro_gui_options_theme_load(void) ro_toolbar_rebuild(toolbar); toolbar_display = calloc(sizeof(struct toolbar_display), 1); if (!toolbar_display) { - LOG("No memory for calloc()"); + NSLOG(netsurf, INFO, "No memory for calloc()"); ro_warn_user("NoMemory", 0); return; } @@ -291,7 +297,8 @@ void ro_gui_options_theme_load(void) state.w = theme_pane; error = xwimp_get_window_state(&state); if (error) { - LOG("xwimp_get_window_state: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_get_window_state: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); return; } diff --git a/frontends/riscos/content-handlers/artworks.c b/frontends/riscos/content-handlers/artworks.c index d6f6da318..8ec4edcae 100644 --- a/frontends/riscos/content-handlers/artworks.c +++ b/frontends/riscos/content-handlers/artworks.c @@ -183,7 +183,7 @@ bool artworks_convert(struct content *c) xos_read_var_val_size("Alias$LoadArtWorksModules", 0, os_VARTYPE_STRING, &used, NULL, NULL); if (used >= 0) { - LOG("Alias$LoadArtWorksModules not defined"); + NSLOG(netsurf, INFO, "Alias$LoadArtWorksModules not defined"); msg_data.error = messages_get("AWNotSeen"); content_broadcast(c, CONTENT_MSG_ERROR, &msg_data); return false; @@ -192,7 +192,8 @@ bool artworks_convert(struct content *c) /* load the modules, or do nothing if they're already loaded */ error = xos_cli("LoadArtWorksModules"); if (error) { - LOG("xos_cli: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xos_cli: 0x%x: %s", error->errnum, + error->errmess); msg_data.error = error->errmess; content_broadcast(c, CONTENT_MSG_ERROR, &msg_data); return false; @@ -202,7 +203,8 @@ bool artworks_convert(struct content *c) error = (os_error*)_swix(AWRender_FileInitAddress, _OUT(0) | _OUT(1), &init_routine, &init_workspace); if (error) { - LOG("AWRender_FileInitAddress: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "AWRender_FileInitAddress: 0x%x: %s", + error->errnum, error->errmess); msg_data.error = error->errmess; content_broadcast(c, CONTENT_MSG_ERROR, &msg_data); return false; @@ -212,7 +214,8 @@ bool artworks_convert(struct content *c) &aw->render_routine, &aw->render_workspace); if (error) { - LOG("AWRender_RenderAddress: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "AWRender_RenderAddress: 0x%x: %s", + error->errnum, error->errmess); msg_data.error = error->errmess; content_broadcast(c, CONTENT_MSG_ERROR, &msg_data); return false; @@ -224,7 +227,8 @@ bool artworks_convert(struct content *c) error = awrender_init(&source_data, &source_size, init_routine, init_workspace); if (error) { - LOG("awrender_init: 0x%x : %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "awrender_init: 0x%x : %s", + error->errnum, error->errmess); msg_data.error = error->errmess; content_broadcast(c, CONTENT_MSG_ERROR, &msg_data); return false; @@ -239,13 +243,15 @@ bool artworks_convert(struct content *c) &aw->y1); if (error) { - LOG("AWRender_DocBounds: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "AWRender_DocBounds: 0x%x: %s", + error->errnum, error->errmess); msg_data.error = error->errmess; content_broadcast(c, CONTENT_MSG_ERROR, &msg_data); return false; } - LOG("bounding box: %d,%d,%d,%d", aw->x0, aw->y0, aw->x1, aw->y1); + NSLOG(netsurf, INFO, "bounding box: %d,%d,%d,%d", aw->x0, aw->y0, + aw->x1, aw->y1); /* create the resizable workspace required by the ArtWorksRenderer rendering routine */ @@ -253,7 +259,8 @@ bool artworks_convert(struct content *c) aw->size = INITIAL_BLOCK_SIZE; aw->block = malloc(INITIAL_BLOCK_SIZE); if (!aw->block) { - LOG("failed to create block for ArtworksRenderer"); + NSLOG(netsurf, INFO, + "failed to create block for ArtworksRenderer"); msg_data.error = messages_get("NoMemory"); content_broadcast(c, CONTENT_MSG_ERROR, &msg_data); return false; @@ -368,13 +375,15 @@ bool artworks_redraw(struct content *c, struct content_redraw_data *data, error = xos_read_vdu_variables(PTR_OS_VDU_VAR_LIST(&vars), vals); if (error) { - LOG("xos_read_vdu_variables: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xos_read_vdu_variables: 0x%x: %s", + error->errnum, error->errmess); return false; } error = xwimp_read_palette((os_palette*)&vals[3]); if (error) { - LOG("xwimp_read_palette: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_read_palette: 0x%x: %s", + error->errnum, error->errmess); return false; } @@ -393,7 +402,8 @@ bool artworks_redraw(struct content *c, struct content_redraw_data *data, aw->render_workspace); if (error) { - LOG("awrender_render: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "awrender_render: 0x%x: %s", + error->errnum, error->errmess); return false; } diff --git a/frontends/riscos/content-handlers/draw.c b/frontends/riscos/content-handlers/draw.c index 4627b19c0..bb66f9dbb 100644 --- a/frontends/riscos/content-handlers/draw.c +++ b/frontends/riscos/content-handlers/draw.c @@ -126,7 +126,8 @@ bool draw_convert(struct content *c) error = xdrawfile_bbox(0, (drawfile_diagram *) data, (int) source_size, 0, &bbox); if (error) { - LOG("xdrawfile_bbox: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xdrawfile_bbox: 0x%x: %s", + error->errnum, error->errmess); msg_data.error = error->errmess; content_broadcast(c, CONTENT_MSG_ERROR, &msg_data); return false; @@ -208,7 +209,8 @@ bool draw_redraw(struct content *c, struct content_redraw_data *data, error = xdrawfile_render(0, (drawfile_diagram *) src_data, (int) source_size, &matrix, 0, 0); if (error) { - LOG("xdrawfile_render: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xdrawfile_render: 0x%x: %s", + error->errnum, error->errmess); return false; } diff --git a/frontends/riscos/content-handlers/sprite.c b/frontends/riscos/content-handlers/sprite.c index 5cbade4e5..3556aa555 100644 --- a/frontends/riscos/content-handlers/sprite.c +++ b/frontends/riscos/content-handlers/sprite.c @@ -135,7 +135,10 @@ bool sprite_convert(struct content *c) (osspriteop_id) ((char *) area + area->first), &w, &h, NULL, NULL); if (error) { - LOG("xosspriteop_read_sprite_info: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, + "xosspriteop_read_sprite_info: 0x%x: %s", + error->errnum, + error->errmess); msg_data.error = error->errmess; content_broadcast(c, CONTENT_MSG_ERROR, &msg_data); return false; diff --git a/frontends/riscos/cookies.c b/frontends/riscos/cookies.c index 614bc3d10..125d04356 100644 --- a/frontends/riscos/cookies.c +++ b/frontends/riscos/cookies.c @@ -445,12 +445,12 @@ nserror ro_gui_cookies_present(void) res = ro_cookie_init(); if (res == NSERROR_OK) { - LOG("Presenting"); + NSLOG(netsurf, INFO, "Presenting"); ro_gui_dialog_open_top(cookie_window->core.wh, cookie_window->core.toolbar, 600, 800); } else { - LOG("Failed presenting code %d", res); + NSLOG(netsurf, INFO, "Failed presenting code %d", res); } return res; diff --git a/frontends/riscos/corewindow.c b/frontends/riscos/corewindow.c index 77dd1c375..84177aa90 100644 --- a/frontends/riscos/corewindow.c +++ b/frontends/riscos/corewindow.c @@ -63,22 +63,22 @@ static void update_scrollbars(struct ro_corewindow *ro_cw, wimp_open *open) int extent_height; os_box extent; - LOG("RO corewindow context %p", ro_cw); + NSLOG(netsurf, INFO, "RO corewindow context %p", ro_cw); /* extent of content in not smaller than window so start there */ extent_width = open->visible.x1 - open->visible.x0; extent_height = open->visible.y0 - open->visible.y1; - LOG("extent w:%d h:%d content w:%d h:%d origin h:%d", - extent_width, extent_height, - ro_cw->content_width, ro_cw->content_height, ro_cw->origin_y); + NSLOG(netsurf, INFO, + "extent w:%d h:%d content w:%d h:%d origin h:%d", extent_width, + extent_height, ro_cw->content_width, ro_cw->content_height, + ro_cw->origin_y); if (ro_cw->content_width > extent_width) { extent_width = ro_cw->content_width; } if (extent_height > (ro_cw->origin_y + ro_cw->content_height)) { extent_height = ro_cw->origin_y + ro_cw->content_height; } - LOG("extent w:%d h:%d", - extent_width, extent_height); + NSLOG(netsurf, INFO, "extent w:%d h:%d", extent_width, extent_height); extent.x0 = 0; extent.y0 = extent_height; extent.x1 = extent_width; @@ -86,15 +86,15 @@ static void update_scrollbars(struct ro_corewindow *ro_cw, wimp_open *open) error = xwimp_set_extent(ro_cw->wh, &extent); if (error) { - LOG("xwimp_set_extent: 0x%x: %s", - error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_set_extent: 0x%x: %s", + error->errnum, error->errmess); return; } error = xwimp_open_window(open); if (error) { - LOG("xwimp_open_window: 0x%x: %s", - error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_open_window: 0x%x: %s", + error->errnum, error->errmess); } } @@ -130,8 +130,8 @@ static void ro_cw_redraw(wimp_draw *redraw) error = xwimp_get_rectangle(redraw, &more); } if (error != NULL) { - LOG("xwimp_redraw_window: 0x%x: %s", - error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_redraw_window: 0x%x: %s", + error->errnum, error->errmess); } } @@ -145,7 +145,7 @@ static void ro_cw_scroll(wimp_scroll *scroll) wimp_open open; ro_cw = (struct ro_corewindow *)ro_gui_wimp_event_get_user_data(scroll->w); - LOG("RO corewindow context %p", ro_cw); + NSLOG(netsurf, INFO, "RO corewindow context %p", ro_cw); page_x = scroll->visible.x1 - scroll->visible.x0 - 32; page_y = scroll->visible.y1 - scroll->visible.y0 - 32; @@ -202,8 +202,8 @@ static void ro_cw_scroll(wimp_scroll *scroll) error = xwimp_open_window(&open); if (error) { - LOG("xwimp_open_window: 0x%x: %s", - error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_open_window: 0x%x: %s", + error->errnum, error->errmess); } } @@ -231,18 +231,18 @@ static void ro_cw_mouse_at(wimp_pointer *pointer, void *data) ro_cw = (struct ro_corewindow *)ro_gui_wimp_event_get_user_data(pointer->w); if (ro_cw == NULL) { - LOG("no corewindow conext for window: 0x%x", - (unsigned int)pointer->w); + NSLOG(netsurf, INFO, "no corewindow conext for window: 0x%x", + (unsigned int)pointer->w); return; } - LOG("RO corewindow context %p", ro_cw); + NSLOG(netsurf, INFO, "RO corewindow context %p", ro_cw); /* Not a Menu click. */ state.w = pointer->w; error = xwimp_get_window_state(&state); if (error) { - LOG("xwimp_get_window_state: 0x%x: %s", - error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_get_window_state: 0x%x: %s", + error->errnum, error->errmess); return; } @@ -285,14 +285,15 @@ static void ro_cw_drag_end(wimp_dragged *drag, void *data) error = xwimp_drag_box((wimp_drag *) -1); if (error) { - LOG("xwimp_drag_box: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_drag_box: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); } error = xwimp_auto_scroll(0, NULL, NULL); if (error) { - LOG("xwimp_auto_scroll: 0x%x: %s", - error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_auto_scroll: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); } } @@ -345,12 +346,13 @@ ro_cw_drag_start(struct ro_corewindow *ro_cw, break; } - LOG("Drag start..."); + NSLOG(netsurf, INFO, "Drag start..."); error = xwimp_drag_box_with_flags(&drag, wimp_DRAG_BOX_KEEP_IN_LINE | wimp_DRAG_BOX_CLIP); if (error) { - LOG("xwimp_drag_box: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_drag_box: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); } else { auto_scroll.w = ro_cw->wh; @@ -364,7 +366,8 @@ ro_cw_drag_start(struct ro_corewindow *ro_cw, error = xwimp_auto_scroll(wimp_AUTO_SCROLL_ENABLE_VERTICAL, &auto_scroll, NULL); if (error) { - LOG("xwimp_auto_scroll: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_auto_scroll: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); } @@ -388,8 +391,8 @@ static void ro_cw_pointer_leaving(wimp_leaving *leaving, void *data) ro_cw = (struct ro_corewindow *)ro_gui_wimp_event_get_user_data(leaving->w); if (ro_cw == NULL) { - LOG("no corewindow conext for window: 0x%x", - (unsigned int)leaving->w); + NSLOG(netsurf, INFO, "no corewindow conext for window: 0x%x", + (unsigned int)leaving->w); return; } @@ -439,14 +442,14 @@ static bool ro_cw_mouse_click(wimp_pointer *pointer) struct ro_corewindow *ro_cw; ro_cw = (struct ro_corewindow *)ro_gui_wimp_event_get_user_data(pointer->w); - LOG("RO corewindow context %p", ro_cw); + NSLOG(netsurf, INFO, "RO corewindow context %p", ro_cw); state.w = ro_cw->wh; error = xwimp_get_window_state(&state); if (error) { - LOG("xwimp_get_window_state: 0x%x: %s", - error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_get_window_state: 0x%x: %s", + error->errnum, error->errmess); return false; } @@ -517,7 +520,7 @@ static bool ro_cw_keypress(wimp_key *key) nserror res; ro_cw = (struct ro_corewindow *)ro_gui_wimp_event_get_user_data(key->w); - LOG("RO corewindow context %p", ro_cw); + NSLOG(netsurf, INFO, "RO corewindow context %p", ro_cw); c = (uint32_t) key->c; @@ -640,8 +643,8 @@ static void cw_tb_size(void *ctx) state.w = ro_cw->wh; error = xwimp_get_window_state(&state); if (error) { - LOG("xwimp_get_window_state: 0x%x: %s", - error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_get_window_state: 0x%x: %s", + error->errnum, error->errmess); return; } @@ -649,8 +652,8 @@ static void cw_tb_size(void *ctx) 0, state.visible.y0 - state.visible.y1, state.visible.x1 - state.visible.x0, 0); if (error) { - LOG("xwimp_force_redraw: 0x%x: %s", - error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_force_redraw: 0x%x: %s", + error->errnum, error->errmess); return; } } @@ -759,8 +762,10 @@ ro_cw_invalidate(struct core_window *cw, const struct rect *r) info.w = ro_cw->wh; error = xwimp_get_window_info_header_only(&info); if (error) { - LOG("xwimp_get_window_info_header_only: 0x%x: %s", - error->errnum, error->errmess); + NSLOG(netsurf, INFO, + "xwimp_get_window_info_header_only: 0x%x: %s", + error->errnum, + error->errmess); return NSERROR_INVALID; } } else { @@ -775,8 +780,8 @@ ro_cw_invalidate(struct core_window *cw, const struct rect *r) info.extent.x0, info.extent.y0, info.extent.x1, info.extent.y1); if (error) { - LOG("xwimp_force_redraw: 0x%x: %s", - error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_force_redraw: 0x%x: %s", + error->errnum, error->errmess); return NSERROR_INVALID; } return NSERROR_OK; @@ -794,8 +799,8 @@ ro_cw_update_size(struct core_window *cw, int width, int height) wimp_window_state state; os_error *error; - LOG("content resize from w:%d h:%d to w:%d h:%d", - ro_cw->content_width, ro_cw->content_height, width, height); + NSLOG(netsurf, INFO, "content resize from w:%d h:%d to w:%d h:%d", + ro_cw->content_width, ro_cw->content_height, width, height); ro_cw->content_width = width * 2; ro_cw->content_height = -(2 * height); @@ -803,8 +808,8 @@ ro_cw_update_size(struct core_window *cw, int width, int height) state.w = ro_cw->wh; error = xwimp_get_window_state(&state); if (error) { - LOG("xwimp_get_window_state: 0x%x: %s", - error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_get_window_state: 0x%x: %s", + error->errnum, error->errmess); return; } @@ -848,8 +853,8 @@ ro_cw_get_window_dimensions(struct core_window *cw, int *width, int *height) state.w = ro_cw->wh; error = xwimp_get_window_state(&state); if (error) { - LOG("xwimp_get_window_state: 0x%x: %s", - error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_get_window_state: 0x%x: %s", + error->errnum, error->errmess); return; } diff --git a/frontends/riscos/dialog.c b/frontends/riscos/dialog.c index 6414778db..a50d1289b 100644 --- a/frontends/riscos/dialog.c +++ b/frontends/riscos/dialog.c @@ -220,7 +220,8 @@ wimp_w ro_gui_dialog_create(const char *template_name) window->sprite_area = gui_sprites; error = xwimp_create_window(window, &w); if (error) { - LOG("xwimp_create_window: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_create_window: 0x%x: %s", + error->errnum, error->errmess); xwimp_close_template(); die(error->errmess); } @@ -259,12 +260,13 @@ wimp_window * ro_gui_dialog_load_template(const char *template_name) error = xwimp_load_template(wimp_GET_SIZE, 0, 0, wimp_NO_FONTS, name, 0, &window_size, &data_size, &context); if (error) { - LOG("xwimp_load_template: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_load_template: 0x%x: %s", + error->errnum, error->errmess); xwimp_close_template(); die(error->errmess); } if (!context) { - LOG("template '%s' missing", template_name); + NSLOG(netsurf, INFO, "template '%s' missing", template_name); xwimp_close_template(); die("Template"); } @@ -281,7 +283,8 @@ wimp_window * ro_gui_dialog_load_template(const char *template_name) error = xwimp_load_template(window, data, data + data_size, wimp_NO_FONTS, name, 0, 0, 0, 0); if (error) { - LOG("xwimp_load_template: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_load_template: 0x%x: %s", + error->errnum, error->errmess); xwimp_close_template(); die(error->errmess); } @@ -309,7 +312,8 @@ void ro_gui_dialog_open(wimp_w w) state.w = w; error = xwimp_get_window_state(&state); if (error) { - LOG("xwimp_get_window_state: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_get_window_state: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); return; } @@ -356,7 +360,8 @@ void ro_gui_dialog_close(wimp_w close) */ error = xwimp_get_caret_position(&caret); if (error) { - LOG("xwimp_get_caret_position: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_get_caret_position: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); } else if (caret.w == close) { /* Check if we are a persistent window */ @@ -367,7 +372,10 @@ void ro_gui_dialog_close(wimp_w close) 32, -1); /* parent may have been closed first */ if ((error) && (error->errnum != 0x287)) { - LOG("xwimp_set_caret_position: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, + "xwimp_set_caret_position: 0x%x: %s", + error->errnum, + error->errmess); ro_warn_user("WimpError", error->errmess); } } @@ -375,7 +383,8 @@ void ro_gui_dialog_close(wimp_w close) error = xwimp_close_window(close); if (error) { - LOG("xwimp_close_window: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_close_window: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); } } @@ -460,7 +469,8 @@ void ro_gui_dialog_open_at_pointer(wimp_w w) /* get the pointer position */ error = xwimp_get_pointer_info(&ptr); if (error) { - LOG("xwimp_get_pointer_info: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_get_pointer_info: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); return; } @@ -483,7 +493,8 @@ void ro_gui_dialog_open_xy(wimp_w w, int x, int y) state.w = w; error = xwimp_get_window_state(&state); if (error) { - LOG("xwimp_get_window_state: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_get_window_state: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); return; } @@ -498,7 +509,8 @@ void ro_gui_dialog_open_xy(wimp_w w, int x, int y) * on screen */ error = xwimp_close_window(w); if (error) { - LOG("xwimp_close_window: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_close_window: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); return; } @@ -527,7 +539,10 @@ static void ro_gui_dialog_open_centre_parent(wimp_w parent, wimp_w child) state.w = parent; error = xwimp_get_window_state(&state); if (error) { - LOG("xwimp_get_window_state: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, + "xwimp_get_window_state: 0x%x: %s", + error->errnum, + error->errmess); ro_warn_user("WimpError", error->errmess); return; } @@ -544,7 +559,8 @@ static void ro_gui_dialog_open_centre_parent(wimp_w parent, wimp_w child) state.w = child; error = xwimp_get_window_state(&state); if (error) { - LOG("xwimp_get_window_state: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_get_window_state: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); return; } @@ -607,7 +623,7 @@ void ro_gui_dialog_add_persistent(wimp_w parent, wimp_w w) { return; } } - LOG("Unable to map persistent dialog to parent."); + NSLOG(netsurf, INFO, "Unable to map persistent dialog to parent."); return; } @@ -636,7 +652,9 @@ void ro_gui_dialog_close_persistent(wimp_w parent) { w = persistent_dialog[i].dialog; ro_gui_dialog_close(w); if (ro_gui_wimp_event_close_window(w)) - LOG("Persistent dialog close event: 0x%x", (unsigned)w); + NSLOG(netsurf, INFO, + "Persistent dialog close event: 0x%x", + (unsigned)w); persistent_dialog[i].parent = NULL; persistent_dialog[i].dialog = NULL; } @@ -713,7 +731,7 @@ static bool ro_gui_dialog_open_url_init(void) if ((definition->icons[ICON_OPENURL_URL].flags & wimp_ICON_INDIRECTED) == 0) { - LOG("open_url URL icon not indirected"); + NSLOG(netsurf, INFO, "open_url URL icon not indirected"); xwimp_close_template(); die("Template"); } @@ -731,7 +749,8 @@ static bool ro_gui_dialog_open_url_init(void) error = xwimp_create_window(definition, &dialog_openurl); if (error != NULL) { - LOG("xwimp_create_window: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_create_window: 0x%x: %s", + error->errnum, error->errmess); xwimp_close_template(); die(error->errmess); } diff --git a/frontends/riscos/download.c b/frontends/riscos/download.c index 561409ed1..bdc705426 100644 --- a/frontends/riscos/download.c +++ b/frontends/riscos/download.c @@ -261,7 +261,10 @@ static nserror download_ro_filetype(download_context *ctx, bits *ftype_out) mime_type = download_context_get_mime_type(ctx); error = xmimemaptranslate_mime_type_to_filetype(mime_type, &ftype); if (error) { - LOG("xmimemaptranslate_mime_type_to_filetype: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, + "xmimemaptranslate_mime_type_to_filetype: 0x%x: %s", + error->errnum, + error->errmess); ro_warn_user("MiscError", error->errmess); ftype = 0xffd; } @@ -339,7 +342,8 @@ gui_download_window_create(download_context *ctx, struct gui_window *gui) error = xosfind_openoutw(osfind_NO_PATH | osfind_ERROR_IF_DIR, temp_name, 0, &dw->file); if (error) { - LOG("xosfind_openoutw: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xosfind_openoutw: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("SaveError", error->errmess); free(dw); return 0; @@ -372,7 +376,7 @@ gui_download_window_create(download_context *ctx, struct gui_window *gui) filename = strdup(temp_name); if (filename == NULL) { - LOG("Failed to establish download filename."); + NSLOG(netsurf, INFO, "Failed to establish download filename."); ro_warn_user("SaveError", error->errmess); free(dw); return 0; @@ -404,7 +408,7 @@ gui_download_window_create(download_context *ctx, struct gui_window *gui) if (err != NSERROR_OK) { /* badenc should never happen */ assert(err !=NSERROR_BAD_ENCODING); - LOG("utf8_to_local_encoding failed"); + NSLOG(netsurf, INFO, "utf8_to_local_encoding failed"); ro_warn_user("NoMemory", 0); free(dw); return 0; @@ -430,7 +434,8 @@ gui_download_window_create(download_context *ctx, struct gui_window *gui) /* create and open the download window */ error = xwimp_create_window(download_template, &dw->window); if (error) { - LOG("xwimp_create_window: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_create_window: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); free(dw); return 0; @@ -485,7 +490,8 @@ static void gui_download_window_error(struct gui_download_window *dw, wimp_COLOUR_RED << wimp_ICON_FG_COLOUR_SHIFT, wimp_ICON_FG_COLOUR); if (error) { - LOG("xwimp_set_icon_state: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_set_icon_state: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); } @@ -493,7 +499,8 @@ static void gui_download_window_error(struct gui_download_window *dw, error = xwimp_set_icon_state(dw->window, ICON_DOWNLOAD_PATH, wimp_ICON_SHADED, 0); if (error) { - LOG("xwimp_set_icon_state: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_set_icon_state: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); } @@ -501,7 +508,8 @@ static void gui_download_window_error(struct gui_download_window *dw, error = xwimp_set_icon_state(dw->window, ICON_DOWNLOAD_ICON, wimp_ICON_SHADED, wimp_ICON_SHADED); if (error) { - LOG("xwimp_set_icon_state: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_set_icon_state: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); } @@ -528,11 +536,13 @@ static nserror gui_download_window_data(struct gui_download_window *dw, error = xosgbpb_writew(dw->file, (const byte *) data, size, &unwritten); if (error) { - LOG("xosgbpb_writew: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xosgbpb_writew: 0x%x: %s", + error->errnum, error->errmess); msg = error->errmess; } else if (unwritten) { - LOG("xosgbpb_writew: unwritten %i", unwritten); + NSLOG(netsurf, INFO, "xosgbpb_writew: unwritten %i", + unwritten); msg = messages_get("Unwritten"); } else { @@ -555,20 +565,29 @@ static nserror gui_download_window_data(struct gui_download_window *dw, error = xwimp_set_icon_state(dw->window, ICON_DOWNLOAD_ICON, wimp_ICON_SHADED, 0); if (error) { - LOG("xwimp_set_icon_state: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, + "xwimp_set_icon_state: 0x%x: %s", + error->errnum, + error->errmess); ro_warn_user("WimpError", error->errmess); } error = xwimp_set_icon_state(dw->window, ICON_DOWNLOAD_DESTINATION, wimp_ICON_DELETED, wimp_ICON_DELETED); if (error) { - LOG("xwimp_set_icon_state: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, + "xwimp_set_icon_state: 0x%x: %s", + error->errnum, + error->errmess); ro_warn_user("WimpError", error->errmess); } error = xwimp_set_icon_state(dw->window, ICON_DOWNLOAD_PATH, wimp_ICON_DELETED, 0); if (error) { - LOG("xwimp_set_icon_state: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, + "xwimp_set_icon_state: 0x%x: %s", + error->errnum, + error->errmess); ro_warn_user("WimpError", error->errmess); } @@ -717,13 +736,15 @@ void ro_gui_download_update_status(struct gui_download_window *dw) download_progress_x0 + width, download_progress_y1); if (error) { - LOG("xwimp_resize_icon: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_resize_icon: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); } error = xwimp_set_icon_state(dw->window, ICON_DOWNLOAD_STATUS, 0, 0); if (error) { - LOG("xwimp_set_icon_state: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_set_icon_state: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); } @@ -759,13 +780,17 @@ void ro_gui_download_window_hide_caret(struct gui_download_window *dw) error = xwimp_get_caret_position(&caret); if (error) { - LOG("xwimp_get_caret_position: 0x%x : %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_get_caret_position: 0x%x : %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); } else if (caret.w == dw->window) { error = xwimp_set_caret_position(dw->window, (wimp_i)-1, 0, 0, 1 << 25, -1); if (error) { - LOG("xwimp_get_caret_position: 0x%x : %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, + "xwimp_get_caret_position: 0x%x : %s", + error->errnum, + error->errmess); ro_warn_user("WimpError", error->errmess); } } @@ -791,7 +816,8 @@ static void gui_download_window_done(struct gui_download_window *dw) error = xosfind_closew(dw->file); if (error) { - LOG("xosfind_closew: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xosfind_closew: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("SaveError", error->errmess); } dw->file = 0; @@ -800,7 +826,8 @@ static void gui_download_window_done(struct gui_download_window *dw) error = xosfile_set_type(dw->path, dw->file_type); if (error) { - LOG("xosfile_set_type: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xosfile_set_type: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("SaveError", error->errmess); } @@ -856,7 +883,8 @@ bool ro_gui_download_click(wimp_pointer *pointer) *dot = 0; error = xos_cli(command); if (error) { - LOG("xos_cli: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xos_cli: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("MiscError", error->errmess); } } @@ -929,7 +957,8 @@ static void ro_gui_download_drag_end(wimp_dragged *drag, void *data) error = xwimp_get_pointer_info(&pointer); if (error) { - LOG("xwimp_get_pointer_info: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_get_pointer_info: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); return; } @@ -959,7 +988,10 @@ static void ro_gui_download_drag_end(wimp_dragged *drag, void *data) error = xwimp_send_message_to_window(wimp_USER_MESSAGE, &message, pointer.w, pointer.i, 0); if (error) { - LOG("xwimp_send_message_to_window: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, + "xwimp_send_message_to_window: 0x%x: %s", + error->errnum, + error->errmess); ro_warn_user("WimpError", error->errmess); } @@ -1011,7 +1043,10 @@ char *ro_gui_download_canonicalise(const char *path) error = xosfscontrol_canonicalise_path(path, NULL, NULL, NULL, 0, &spare); if (error) { - LOG("xosfscontrol_canonicalise_path: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, + "xosfscontrol_canonicalise_path: 0x%x: %s", + error->errnum, + error->errmess); return NULL; } @@ -1020,7 +1055,10 @@ char *ro_gui_download_canonicalise(const char *path) error = xosfscontrol_canonicalise_path(path, buf, NULL, NULL, 1 - spare, NULL); if (error) { - LOG("xosfscontrol_canonicalise_path: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, + "xosfscontrol_canonicalise_path: 0x%x: %s", + error->errnum, + error->errmess); free(buf); return NULL; @@ -1065,13 +1103,17 @@ bool ro_gui_download_check_space(struct gui_download_window *dw, error = xosfscontrol_free_space64(dir, &free_lo, &free_hi, &max_file, NULL, NULL); if (error) { - LOG("xosfscontrol_free_space64: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xosfscontrol_free_space64: 0x%x: %s", + error->errnum, error->errmess); free_hi = 0; error = xosfscontrol_free_space(dir, (int*)&free_lo, &max_file, NULL); if (error) { - LOG("xosfscontrol_free_space: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, + "xosfscontrol_free_space: 0x%x: %s", + error->errnum, + error->errmess); /* close our eyes and hope */ free(dir); return true; @@ -1108,7 +1150,10 @@ bool ro_gui_download_check_space(struct gui_download_window *dw, error = xosargs_read_allocation(dw->file, &allocation); if (error) { - LOG("xosargs_read_allocation: 0x%x : %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, + "xosargs_read_allocation: 0x%x : %s", + error->errnum, + error->errmess); } else { space += allocation; @@ -1147,7 +1192,8 @@ os_error *ro_gui_download_move(struct gui_download_window *dw, error = xosfind_closew(dw->file); dw->file = 0; if (error) { - LOG("xosfind_closew: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xosfind_closew: 0x%x: %s", + error->errnum, error->errmess); return error; } } @@ -1165,11 +1211,13 @@ os_error *ro_gui_download_move(struct gui_download_window *dw, osfscontrol_COPY_LOOK, 0, 0, 0, 0, 0); if (error) { - LOG("xosfscontrol_copy: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xosfscontrol_copy: 0x%x: %s", + error->errnum, error->errmess); return error; } } else if (error) { - LOG("xosfscontrol_rename: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xosfscontrol_rename: 0x%x: %s", + error->errnum, error->errmess); return error; } @@ -1179,20 +1227,23 @@ os_error *ro_gui_download_move(struct gui_download_window *dw, fileswitch_ATTR_OWNER_READ | fileswitch_ATTR_OWNER_WRITE); if (error) { - LOG("xosfile_write: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xosfile_write: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("SaveError", error->errmess); } error = xosfind_openupw(osfind_NO_PATH | osfind_ERROR_IF_DIR, dest_file, 0, &dw->file); if (error) { - LOG("xosfind_openupw: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xosfind_openupw: 0x%x: %s", + error->errnum, error->errmess); return error; } error = xosargs_set_ptrw(dw->file, dw->received); if (error) { - LOG("xosargs_set_ptrw: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xosargs_set_ptrw: 0x%x: %s", + error->errnum, error->errmess); return error; } @@ -1201,7 +1252,8 @@ os_error *ro_gui_download_move(struct gui_download_window *dw, error = xosfile_set_type(dest_file, dw->file_type); if (error) { - LOG("xosfile_set_type: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xosfile_set_type: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("SaveError", error->errmess); } } @@ -1273,7 +1325,8 @@ bool ro_gui_download_save(struct gui_download_window *dw, error = xosfile_read_stamped(file_name, &obj_type, NULL, NULL, NULL, NULL, NULL); if (error) { - LOG("xosfile_read_stamped: 0x%x:%s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xosfile_read_stamped: 0x%x:%s", + error->errnum, error->errmess); return false; } @@ -1309,12 +1362,16 @@ bool ro_gui_download_save(struct gui_download_window *dw, error = xosfind_openupw(osfind_NO_PATH | osfind_ERROR_IF_DIR, temp_name, 0, &dw->file); if (error) { - LOG("xosfind_openupw: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xosfind_openupw: 0x%x: %s", + error->errnum, error->errmess); } else { error = xosargs_set_ptrw(dw->file, dw->received); if (error) { - LOG("xosargs_set_ptrw: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, + "xosargs_set_ptrw: 0x%x: %s", + error->errnum, + error->errmess); } } @@ -1336,7 +1393,8 @@ bool ro_gui_download_save(struct gui_download_window *dw, error = xwimp_set_icon_state(dw->window, ICON_DOWNLOAD_ICON, wimp_ICON_SHADED, wimp_ICON_SHADED); if (error) { - LOG("xwimp_set_icon_state: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_set_icon_state: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); } @@ -1349,13 +1407,15 @@ bool ro_gui_download_save(struct gui_download_window *dw, error = xwimp_set_icon_state(dw->window, ICON_DOWNLOAD_PATH, wimp_ICON_DELETED, wimp_ICON_DELETED); if (error) { - LOG("xwimp_set_icon_state: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_set_icon_state: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); } error = xwimp_set_icon_state(dw->window, ICON_DOWNLOAD_DESTINATION, wimp_ICON_DELETED, 0); if (error) { - LOG("xwimp_set_icon_state: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_set_icon_state: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); } @@ -1401,7 +1461,8 @@ void ro_gui_download_send_dataload(struct gui_download_window *dw) * for the rather depressing details. */ if (error && error->errnum != error_WIMP_BAD_HANDLE) { - LOG("xwimp_set_icon_state: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_set_icon_state: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); } @@ -1482,7 +1543,8 @@ bool ro_gui_download_window_destroy(struct gui_download_window *dw, bool quit) /* delete window */ error = xwimp_delete_window(dw->window); if (error) { - LOG("xwimp_delete_window: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_delete_window: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); } ro_gui_wimp_event_finalise(dw->window); @@ -1491,7 +1553,8 @@ bool ro_gui_download_window_destroy(struct gui_download_window *dw, bool quit) if (dw->file) { error = xosfind_closew(dw->file); if (error) { - LOG("xosfind_closew: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xosfind_closew: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("SaveError", error->errmess); } } @@ -1502,7 +1565,8 @@ bool ro_gui_download_window_destroy(struct gui_download_window *dw, bool quit) error = xosfile_delete(temp_name, 0, 0, 0, 0, 0); if (error) { - LOG("xosfile_delete: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xosfile_delete: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("SaveError", error->errmess); } } diff --git a/frontends/riscos/filetype.c b/frontends/riscos/filetype.c index 75ff41414..73651cd63 100644 --- a/frontends/riscos/filetype.c +++ b/frontends/riscos/filetype.c @@ -72,7 +72,7 @@ const char *fetch_filetype(const char *unix_path) int objtype; if (!path) { - LOG("Insufficient memory for calloc"); + NSLOG(netsurf, INFO, "Insufficient memory for calloc"); ro_warn_user("NoMemory", 0); return "application/riscos"; } @@ -80,7 +80,7 @@ const char *fetch_filetype(const char *unix_path) /* convert path to RISC OS format and read file type */ r = __riscosify(unix_path, 0, __RISCOSIFY_NO_SUFFIX, path, len, 0); if (r == 0) { - LOG("__riscosify failed"); + NSLOG(netsurf, INFO, "__riscosify failed"); free(path); return "application/riscos"; } @@ -88,7 +88,9 @@ const char *fetch_filetype(const char *unix_path) error = xosfile_read_stamped_no_path(path, &objtype, 0, 0, 0, 0, &file_type); if (error) { - LOG("xosfile_read_stamped_no_path failed: %s", error->errmess); + NSLOG(netsurf, INFO, + "xosfile_read_stamped_no_path failed: %s", + error->errmess); free(path); return "application/riscos"; } @@ -108,7 +110,10 @@ const char *fetch_filetype(const char *unix_path) slash+1, &temp); if (error) /* ignore error and leave file_type alone */ - LOG("xmimemaptranslate_extension_to_filetype: ""0x%x %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, + "xmimemaptranslate_extension_to_filetype: ""0x%x %s", + error->errnum, + error->errmess); else file_type = temp; } @@ -126,7 +131,7 @@ const char *fetch_filetype(const char *unix_path) /* not in internal table, so ask MimeMap */ error = xmimemaptranslate_filetype_to_mime_type(file_type, type_buf); if (error) { - LOG("0x%x %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "0x%x %s", error->errnum, error->errmess); free(path); return "application/riscos"; } @@ -139,7 +144,7 @@ const char *fetch_filetype(const char *unix_path) free(path); - LOG("mime type '%s'", type_buf); + NSLOG(netsurf, INFO, "mime type '%s'", type_buf); return (const char *)type_buf; } @@ -155,14 +160,15 @@ char *fetch_mimetype(const char *ro_path) struct type_entry *t; if (!mime) { - LOG("Insufficient memory for calloc"); + NSLOG(netsurf, INFO, "Insufficient memory for calloc"); ro_warn_user("NoMemory", 0); return 0; } e = xosfile_read_no_path(ro_path, &objtype, &load, 0, 0, 0); if (e) { - LOG("xosfile_read_no_path: 0x%x: %s", e->errnum, e->errmess); + NSLOG(netsurf, INFO, "xosfile_read_no_path: 0x%x: %s", + e->errnum, e->errmess); free(mime); return 0; } @@ -188,7 +194,7 @@ char *fetch_mimetype(const char *ro_path) if (e) /* if we get an error here, simply ignore it and * leave filetype unchanged */ - LOG("0x%x %s", e->errnum, e->errmess); + NSLOG(netsurf, INFO, "0x%x %s", e->errnum, e->errmess); else filetype = load; } @@ -205,7 +211,10 @@ char *fetch_mimetype(const char *ro_path) /* not in internal table, so ask MimeMap */ e = xmimemaptranslate_filetype_to_mime_type(filetype, mime); if (e) { - LOG("xmimemaptranslate_filetype_to_mime_type: 0x%x: %s", e->errnum, e->errmess); + NSLOG(netsurf, INFO, + "xmimemaptranslate_filetype_to_mime_type: 0x%x: %s", + e->errnum, + e->errmess); free(mime); return 0; } @@ -322,7 +331,7 @@ bits ro_filetype_from_unix_path(const char *unix_path) bits file_type; if (!path) { - LOG("Insufficient memory for calloc"); + NSLOG(netsurf, INFO, "Insufficient memory for calloc"); ro_warn_user("NoMemory", 0); return osfile_TYPE_DATA; } @@ -330,7 +339,7 @@ bits ro_filetype_from_unix_path(const char *unix_path) /* convert path to RISC OS format and read file type */ r = __riscosify(unix_path, 0, __RISCOSIFY_NO_SUFFIX, path, len, 0); if (r == 0) { - LOG("__riscosify failed"); + NSLOG(netsurf, INFO, "__riscosify failed"); free(path); return osfile_TYPE_DATA; } @@ -338,7 +347,9 @@ bits ro_filetype_from_unix_path(const char *unix_path) error = xosfile_read_stamped_no_path(path, 0, 0, 0, 0, 0, &file_type); if (error) { - LOG("xosfile_read_stamped_no_path failed: %s", error->errmess); + NSLOG(netsurf, INFO, + "xosfile_read_stamped_no_path failed: %s", + error->errmess); free(path); return osfile_TYPE_DATA; } diff --git a/frontends/riscos/font.c b/frontends/riscos/font.c index 560afc785..8913efeeb 100644 --- a/frontends/riscos/font.c +++ b/frontends/riscos/font.c @@ -65,7 +65,8 @@ static void nsfont_check_fonts(void) ".FixFonts", 0); die("FontBadInst"); } else { - LOG("xfont_find_font: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xfont_find_font: 0x%x: %s", + error->errnum, error->errmess); snprintf(s, sizeof s, messages_get("FontError"), error->errmess); die(s); @@ -74,7 +75,8 @@ static void nsfont_check_fonts(void) error = xfont_lose_font(font); if (error) { - LOG("xfont_lose_font: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xfont_lose_font: 0x%x: %s", + error->errnum, error->errmess); snprintf(s, sizeof s, messages_get("FontError"), error->errmess); die(s); @@ -118,17 +120,20 @@ void nsfont_init(void) nsfont_check_fonts(); - LOG("Initialise RUfl"); + NSLOG(netsurf, INFO, "Initialise RUfl"); code = rufl_init(); if (code != rufl_OK) { if (code == rufl_FONT_MANAGER_ERROR) - LOG("rufl_init: rufl_FONT_MANAGER_ERROR: 0x%x: %s", rufl_fm_error->errnum, rufl_fm_error->errmess); + NSLOG(netsurf, INFO, + "rufl_init: rufl_FONT_MANAGER_ERROR: 0x%x: %s", + rufl_fm_error->errnum, + rufl_fm_error->errmess); else - LOG("rufl_init: 0x%x", code); + NSLOG(netsurf, INFO, "rufl_init: 0x%x", code); die("The Unicode font library could not be initialized. " "Please report this to the developers."); } - LOG("RUfl initialised"); + NSLOG(netsurf, INFO, "RUfl initialised"); if (rufl_family_list_entries == 0) die("No fonts could be found. At least one font must be " @@ -162,9 +167,10 @@ const char *nsfont_fallback_font(void) const char *fallback = "Homerton"; if (!nsfont_exists(fallback)) { - LOG("Homerton not found, dumping RUfl family list"); + NSLOG(netsurf, INFO, + "Homerton not found, dumping RUfl family list"); for (unsigned int i = 0; i < rufl_family_list_entries; i++) { - LOG("'%s'", rufl_family_list[i]); + NSLOG(netsurf, INFO, "'%s'", rufl_family_list[i]); } fallback = rufl_family_list[0]; } @@ -230,9 +236,12 @@ ro_font_width(const plot_font_style_t *fstyle, width); if (code != rufl_OK) { if (code == rufl_FONT_MANAGER_ERROR) - LOG("rufl_width: rufl_FONT_MANAGER_ERROR: 0x%x: %s", rufl_fm_error->errnum, rufl_fm_error->errmess); + NSLOG(netsurf, INFO, + "rufl_width: rufl_FONT_MANAGER_ERROR: 0x%x: %s", + rufl_fm_error->errnum, + rufl_fm_error->errmess); else - LOG("rufl_width: 0x%x", code); + NSLOG(netsurf, INFO, "rufl_width: 0x%x", code); /* ro_warn_user("MiscError", "font error"); */ *width = 0; return NSERROR_INVALID; @@ -276,9 +285,12 @@ ro_font_position(const plot_font_style_t *fstyle, x * 2, char_offset, actual_x); if (code != rufl_OK) { if (code == rufl_FONT_MANAGER_ERROR) - LOG("rufl_x_to_offset: rufl_FONT_MANAGER_ERROR: ""0x%x: %s", rufl_fm_error->errnum, rufl_fm_error->errmess); + NSLOG(netsurf, INFO, + "rufl_x_to_offset: rufl_FONT_MANAGER_ERROR: ""0x%x: %s", + rufl_fm_error->errnum, + rufl_fm_error->errmess); else - LOG("rufl_x_to_offset: 0x%x", code); + NSLOG(netsurf, INFO, "rufl_x_to_offset: 0x%x", code); /* ro_warn_user("MiscError", "font error"); */ *char_offset = 0; *actual_x = 0; @@ -335,10 +347,12 @@ ro_font_split(const plot_font_style_t *fstyle, x * 2, char_offset, actual_x); if (code != rufl_OK) { if (code == rufl_FONT_MANAGER_ERROR) { - LOG("rufl_split: rufl_FONT_MANAGER_ERROR: ""0x%x: %s", - rufl_fm_error->errnum, rufl_fm_error->errmess); + NSLOG(netsurf, INFO, + "rufl_split: rufl_FONT_MANAGER_ERROR: ""0x%x: %s", + rufl_fm_error->errnum, + rufl_fm_error->errmess); } else { - LOG("rufl_split: 0x%x", code); + NSLOG(netsurf, INFO, "rufl_split: 0x%x", code); } /* ro_warn_user("MiscError", "font error"); */ *char_offset = 0; @@ -370,10 +384,12 @@ ro_font_split(const plot_font_style_t *fstyle, actual_x); if (code != rufl_OK) { if (code == rufl_FONT_MANAGER_ERROR) { - LOG("rufl_width: rufl_FONT_MANAGER_ERROR: 0x%x: %s", - rufl_fm_error->errnum, rufl_fm_error->errmess); + NSLOG(netsurf, INFO, + "rufl_width: rufl_FONT_MANAGER_ERROR: 0x%x: %s", + rufl_fm_error->errnum, + rufl_fm_error->errmess); } else { - LOG("rufl_width: 0x%x", code); + NSLOG(netsurf, INFO, "rufl_width: 0x%x", code); } /* ro_warn_user("MiscError", "font error"); */ *char_offset = 0; @@ -416,9 +432,12 @@ bool nsfont_paint(const plot_font_style_t *fstyle, const char *string, string, length, x, y, flags); if (code != rufl_OK) { if (code == rufl_FONT_MANAGER_ERROR) { - LOG("rufl_paint: rufl_FONT_MANAGER_ERROR: 0x%x: %s", rufl_fm_error->errnum, rufl_fm_error->errmess); + NSLOG(netsurf, INFO, + "rufl_paint: rufl_FONT_MANAGER_ERROR: 0x%x: %s", + rufl_fm_error->errnum, + rufl_fm_error->errmess); } else { - LOG("rufl_paint: 0x%x", code); + NSLOG(netsurf, INFO, "rufl_paint: 0x%x", code); } } @@ -513,7 +532,8 @@ ro_gui_wimp_desktop_font(char *family, error = xwimpreadsysinfo_font(&font_handle, NULL); if (error) { - LOG("xwimpreadsysinfo_font: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimpreadsysinfo_font: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); goto failsafe; } @@ -525,20 +545,22 @@ ro_gui_wimp_desktop_font(char *family, error = xfont_read_identifier(font_handle, NULL, &used); if (error) { - LOG("xfont_read_identifier: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xfont_read_identifier: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("MiscError", error->errmess); goto failsafe; } if (family_size < (size_t) used + 1) { - LOG("desktop font name too long"); + NSLOG(netsurf, INFO, "desktop font name too long"); goto failsafe; } error = xfont_read_defn(font_handle, (byte *) family, &ptx, &pty, NULL, NULL, NULL, NULL); if (error) { - LOG("xfont_read_defn: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xfont_read_defn: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("MiscError", error->errmess); goto failsafe; } @@ -550,7 +572,7 @@ ro_gui_wimp_desktop_font(char *family, } } - LOG("desktop font \"%s\"", family); + NSLOG(netsurf, INFO, "desktop font \"%s\"", family); if (strcasestr(family, ".Medium")) style = rufl_WEIGHT_500; @@ -566,7 +588,8 @@ ro_gui_wimp_desktop_font(char *family, *psize = max(ptx, pty); *pstyle = style; - LOG("family \"%s\", size %i, style %i", family, *psize, style); + NSLOG(netsurf, INFO, "family \"%s\", size %i, style %i", family, + *psize, style); return; diff --git a/frontends/riscos/global_history.c b/frontends/riscos/global_history.c index d122a4d7f..7dfc58317 100644 --- a/frontends/riscos/global_history.c +++ b/frontends/riscos/global_history.c @@ -474,12 +474,12 @@ nserror ro_gui_global_history_present(void) res = ro_global_history_init(); if (res == NSERROR_OK) { - LOG("Presenting"); + NSLOG(netsurf, INFO, "Presenting"); ro_gui_dialog_open_top(global_history_window->core.wh, global_history_window->core.toolbar, 600, 800); } else { - LOG("Failed presenting code %d", res); + NSLOG(netsurf, INFO, "Failed presenting code %d", res); } return res; diff --git a/frontends/riscos/gui.c b/frontends/riscos/gui.c index 576e1ff12..51ea37066 100644 --- a/frontends/riscos/gui.c +++ b/frontends/riscos/gui.c @@ -307,7 +307,7 @@ static nserror set_defaults(struct nsoption_s *defaults) if (nsoption_charp(ca_bundle) == NULL || nsoption_charp(cookie_file) == NULL || nsoption_charp(cookie_jar) == NULL) { - LOG("Failed initialising default options"); + NSLOG(netsurf, INFO, "Failed initialising default options"); return NSERROR_BAD_PARAMETER; } @@ -430,7 +430,7 @@ static void ro_gui_signal(int sig) if (used) { int curr_slot; xwimp_slot_size(-1, -1, &curr_slot, 0, 0); - LOG("saving WimpSlot, size 0x%x", curr_slot); + NSLOG(netsurf, INFO, "saving WimpSlot, size 0x%x", curr_slot); xosfile_save("$.NetSurf_Slot", 0x8000, 0, (byte *) 0x8000, (byte *) 0x8000 + curr_slot); @@ -440,7 +440,11 @@ static void ro_gui_signal(int sig) byte *base_address; xosdynamicarea_read(__dynamic_num, &size, &base_address, 0, 0, 0, 0, 0); - LOG("saving DA %i, base %p, size 0x%x", __dynamic_num, base_address, size); + NSLOG(netsurf, INFO, + "saving DA %i, base %p, size 0x%x", + __dynamic_num, + base_address, + size); xosfile_save("$.NetSurf_DA", (bits) base_address, 0, base_address, @@ -452,7 +456,7 @@ static void ro_gui_signal(int sig) * defines a coredump directory. */ const _kernel_oserror *err = __unixlib_write_coredump (NULL); if (err != NULL) - LOG("Coredump failed: %s", err->errmess); + NSLOG(netsurf, INFO, "Coredump failed: %s", err->errmess); #endif xhourglass_colours(old_sand, old_glass, 0, 0); @@ -536,7 +540,8 @@ static char *ro_gui_uri_file_parse(const char *file_name, char **uri_title) *uri_title = NULL; fp = fopen(file_name, "rb"); if (!fp) { - LOG("fopen(\"%s\", \"rb\"): %i: %s", file_name, errno, strerror(errno)); + NSLOG(netsurf, INFO, "fopen(\"%s\", \"rb\"): %i: %s", + file_name, errno, strerror(errno)); ro_warn_user("LoadError", strerror(errno)); return 0; } @@ -597,14 +602,16 @@ static char *ro_gui_url_file_parse(const char *file_name) fp = fopen(file_name, "r"); if (!fp) { - LOG("fopen(\"%s\", \"r\"): %i: %s", file_name, errno, strerror(errno)); + NSLOG(netsurf, INFO, "fopen(\"%s\", \"r\"): %i: %s", + file_name, errno, strerror(errno)); ro_warn_user("LoadError", strerror(errno)); return 0; } if (!fgets(line, sizeof line, fp)) { if (ferror(fp)) { - LOG("fgets: %i: %s", errno, strerror(errno)); + NSLOG(netsurf, INFO, "fgets: %i: %s", errno, + strerror(errno)); ro_warn_user("LoadError", strerror(errno)); } else ro_warn_user("LoadError", messages_get("EmptyError")); @@ -641,7 +648,8 @@ static char *ro_gui_ieurl_file_parse(const char *file_name) fp = fopen(file_name, "r"); if (!fp) { - LOG("fopen(\"%s\", \"r\"): %i: %s", file_name, errno, strerror(errno)); + NSLOG(netsurf, INFO, "fopen(\"%s\", \"r\"): %i: %s", + file_name, errno, strerror(errno)); ro_warn_user("LoadError", strerror(errno)); return 0; } @@ -660,7 +668,7 @@ static char *ro_gui_ieurl_file_parse(const char *file_name) } } if (ferror(fp)) { - LOG("fgets: %i: %s", errno, strerror(errno)); + NSLOG(netsurf, INFO, "fgets: %i: %s", errno, strerror(errno)); ro_warn_user("LoadError", strerror(errno)); fclose(fp); return 0; @@ -732,7 +740,8 @@ static void ro_msg_dataopen(wimp_message *message) message->your_ref = message->my_ref; oserror = xwimp_send_message(wimp_USER_MESSAGE, message, message->sender); if (oserror) { - LOG("xwimp_send_message: 0x%x: %s", oserror->errnum, oserror->errmess); + NSLOG(netsurf, INFO, "xwimp_send_message: 0x%x: %s", + oserror->errnum, oserror->errmess); ro_warn_user("WimpError", oserror->errmess); return; } @@ -855,7 +864,8 @@ static void ro_msg_dataload(wimp_message *message) oserror = xwimp_send_message(wimp_USER_MESSAGE, message, message->sender); if (oserror) { - LOG("xwimp_send_message: 0x%x: %s", oserror->errnum, oserror->errmess); + NSLOG(netsurf, INFO, "xwimp_send_message: 0x%x: %s", + oserror->errnum, oserror->errmess); ro_warn_user("WimpError", oserror->errmess); return; } @@ -925,7 +935,10 @@ static void ro_msg_datasave(wimp_message *message) error = xwimp_send_message(wimp_USER_MESSAGE, (wimp_message*)dataxfer, message->sender); if (error) { - LOG("xwimp_send_message: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, + "xwimp_send_message: 0x%x: %s", + error->errnum, + error->errmess); ro_warn_user("WimpError", error->errmess); } } @@ -977,7 +990,8 @@ static void ro_msg_prequit(wimp_message *message) error = xwimp_send_message(wimp_USER_MESSAGE_ACKNOWLEDGE, message, message->sender); if (error) { - LOG("xwimp_send_message: 0x%x:%s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_send_message: 0x%x:%s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); } } @@ -1003,7 +1017,8 @@ static void ro_msg_save_desktop(wimp_message *message) } if (error) { - LOG("xosgbpb_writew/xos_bputw: 0x%x:%s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xosgbpb_writew/xos_bputw: 0x%x:%s", + error->errnum, error->errmess); ro_warn_user("SaveError", error->errmess); /* we must cancel the save by acknowledging the message */ @@ -1011,7 +1026,8 @@ static void ro_msg_save_desktop(wimp_message *message) error = xwimp_send_message(wimp_USER_MESSAGE_ACKNOWLEDGE, message, message->sender); if (error) { - LOG("xwimp_send_message: 0x%x:%s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_send_message: 0x%x:%s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); } } @@ -1062,7 +1078,8 @@ static void ro_gui_get_screen_properties(void) error = xos_read_vdu_variables(PTR_OS_VDU_VAR_LIST(&vars), vals); if (error) { - LOG("xos_read_vdu_variables: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xos_read_vdu_variables: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("MiscError", error->errmess); return; } @@ -1079,9 +1096,9 @@ static void ro_gui_check_resolvers(void) char *resolvers; resolvers = getenv("Inet$Resolvers"); if (resolvers && resolvers[0]) { - LOG("Inet$Resolvers '%s'", resolvers); + NSLOG(netsurf, INFO, "Inet$Resolvers '%s'", resolvers); } else { - LOG("Inet$Resolvers not set or empty"); + NSLOG(netsurf, INFO, "Inet$Resolvers not set or empty"); ro_warn_user("Resolvers", 0); } } @@ -1196,7 +1213,8 @@ static nserror gui_init(int argc, char** argv) PTR_WIMP_MESSAGE_LIST(&task_messages), 0, &task_handle); if (error) { - LOG("xwimp_initialise: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_initialise: 0x%x: %s", + error->errnum, error->errmess); die(error->errmess); } /* Register message handlers */ @@ -1234,7 +1252,8 @@ static nserror gui_init(int argc, char** argv) die("Failed to locate Templates resource."); error = xwimp_open_template(path); if (error) { - LOG("xwimp_open_template failed: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_open_template failed: 0x%x: %s", + error->errnum, error->errmess); die(error->errmess); } @@ -1275,7 +1294,7 @@ static nserror gui_init(int argc, char** argv) /* parse command-line arguments */ if (argc == 2) { - LOG("parameters: '%s'", argv[1]); + NSLOG(netsurf, INFO, "parameters: '%s'", argv[1]); /* this is needed for launching URI files */ if (strcasecmp(argv[1], "-nowin") == 0) { return NSERROR_OK; @@ -1283,7 +1302,8 @@ static nserror gui_init(int argc, char** argv) ret = nsurl_create(NETSURF_HOMEPAGE, &url); } else if (argc == 3) { - LOG("parameters: '%s' '%s'", argv[1], argv[2]); + NSLOG(netsurf, INFO, "parameters: '%s' '%s'", argv[1], + argv[2]); open_window = true; /* HTML files */ @@ -1294,7 +1314,7 @@ static nserror gui_init(int argc, char** argv) else if (strcasecmp(argv[1], "-urlf") == 0) { char *urlf = ro_gui_url_file_parse(argv[2]); if (!urlf) { - LOG("allocation failed"); + NSLOG(netsurf, INFO, "allocation failed"); die("Insufficient memory for URL"); } ret = nsurl_create(urlf, &url); @@ -1306,7 +1326,8 @@ static nserror gui_init(int argc, char** argv) } /* Unknown => exit here. */ else { - LOG("Unknown parameters: '%s' '%s'", argv[1], argv[2]); + NSLOG(netsurf, INFO, "Unknown parameters: '%s' '%s'", + argv[1], argv[2]); return NSERROR_BAD_PARAMETER; } } @@ -1354,7 +1375,8 @@ const char *ro_gui_default_language(void) /* choose a language from the configured country number */ error = xosbyte_read(osbyte_VAR_COUNTRY_NUMBER, &country); if (error) { - LOG("xosbyte_read failed: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xosbyte_read failed: 0x%x: %s", + error->errnum, error->errmess); country = 1; } switch (country) { @@ -1405,7 +1427,10 @@ static nserror ro_path_to_nsurl(const char *path, struct nsurl **url_out) /* calculate the canonical risc os path */ error = xosfscontrol_canonicalise_path(path, 0, 0, 0, 0, &spare); if (error) { - LOG("xosfscontrol_canonicalise_path failed: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, + "xosfscontrol_canonicalise_path failed: 0x%x: %s", + error->errnum, + error->errmess); ro_warn_user("PathToURL", error->errmess); return NSERROR_NOT_FOUND; } @@ -1418,7 +1443,10 @@ static nserror ro_path_to_nsurl(const char *path, struct nsurl **url_out) error = xosfscontrol_canonicalise_path(path, canonical_path, 0, 0, 1 - spare, 0); if (error) { - LOG("xosfscontrol_canonicalise_path failed: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, + "xosfscontrol_canonicalise_path failed: 0x%x: %s", + error->errnum, + error->errmess); ro_warn_user("PathToURL", error->errmess); free(canonical_path); return NSERROR_NOT_FOUND; @@ -1428,7 +1456,7 @@ static nserror ro_path_to_nsurl(const char *path, struct nsurl **url_out) unix_path = __unixify(canonical_path, __RISCOSIFY_NO_REVERSE_SUFFIX, NULL, 0, 0); if (unix_path == NULL) { - LOG("__unixify failed: %s", canonical_path); + NSLOG(netsurf, INFO, "__unixify failed: %s", canonical_path); free(canonical_path); return NSERROR_BAD_PARAMETER; } @@ -1446,7 +1474,7 @@ static nserror ro_path_to_nsurl(const char *path, struct nsurl **url_out) urllen = strlen(escaped_path) + FILE_SCHEME_PREFIX_LEN + 1; url = malloc(urllen); if (url == NULL) { - LOG("Unable to allocate url"); + NSLOG(netsurf, INFO, "Unable to allocate url"); free(escaped_path); return NSERROR_NOMEM; } @@ -1596,7 +1624,8 @@ static void ro_gui_keypress_cb(void *pw) if (ro_gui_wimp_event_keypress(key) == false) { os_error *error = xwimp_process_key(key->c); if (error) { - LOG("xwimp_process_key: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_process_key: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); } } @@ -1633,7 +1662,8 @@ static void ro_gui_keypress(wimp_key *key) } else if (ro_gui_wimp_event_keypress(key) == false) { os_error *error = xwimp_process_key(key->c); if (error) { - LOG("xwimp_process_key: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_process_key: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); } } @@ -1905,7 +1935,8 @@ void ro_gui_open_window_request(wimp_open *open) error = xwimp_open_window(open); if (error) { - LOG("xwimp_open_window: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_open_window: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); return; } @@ -1926,7 +1957,8 @@ static void ro_gui_view_source_bounce(wimp_message *message) sprintf(command, "@RunType_FFF %s", filename); error = xwimp_start_task(command, 0); if (error) { - LOG("xwimp_start_task failed: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_start_task failed: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); } } @@ -1989,7 +2021,7 @@ void ro_gui_view_source(struct hlcache_handle *c) r = __riscosify(full_name, 0, __RISCOSIFY_NO_SUFFIX, message.file_name, 212, 0); if (r == 0) { - LOG("__riscosify failed"); + NSLOG(netsurf, INFO, "__riscosify failed"); return; } message.file_name[211] = '\0'; @@ -1999,7 +2031,10 @@ void ro_gui_view_source(struct hlcache_handle *c) (byte *) source_data, (byte *) source_data + source_size); if (error) { - LOG("xosfile_save_stamped failed: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, + "xosfile_save_stamped failed: 0x%x: %s", + error->errnum, + error->errmess); ro_warn_user("MiscError", error->errmess); return; } @@ -2069,7 +2104,7 @@ static void ro_gui_choose_language(void) */ nserror ro_warn_user(const char *warning, const char *detail) { - LOG("%s %s", warning, detail); + NSLOG(netsurf, INFO, "%s %s", warning, detail); if (dialog_warning) { char warn_buffer[300]; @@ -2113,7 +2148,7 @@ void die(const char * const error) { os_error warn_error; - LOG("%s", error); + NSLOG(netsurf, INFO, "%s", error); warn_error.errnum = 1; /* \todo: reasonable ? */ strncpy(warn_error.errmess, messages_get(error), @@ -2350,7 +2385,7 @@ void ro_gui_dump_browser_window(struct browser_window *bw) /* open file for dump */ FILE *stream = fopen(".WWW.NetSurf.dump", "w"); if (!stream) { - LOG("fopen: errno %i", errno); + NSLOG(netsurf, INFO, "fopen: errno %i", errno); ro_warn_user("SaveError", strerror(errno)); return; } @@ -2363,7 +2398,8 @@ void ro_gui_dump_browser_window(struct browser_window *bw) error = xwimp_start_task("Filer_Run .WWW.NetSurf.dump", 0); if (error) { - LOG("xwimp_start_task failed: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_start_task failed: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); } } @@ -2403,7 +2439,7 @@ static char *get_cachepath(void) cachedir = getenv("Cache$Dir"); if ((cachedir == NULL) || (cachedir[0] == 0)) { - LOG("cachedir was null"); + NSLOG(netsurf, INFO, "cachedir was null"); return NULL; } ret = netsurf_mkpath(&cachepath, NULL, 2, cachedir, "NetSurf"); diff --git a/frontends/riscos/gui/button_bar.c b/frontends/riscos/gui/button_bar.c index 6ecd7cffa..34ae39ae5 100644 --- a/frontends/riscos/gui/button_bar.c +++ b/frontends/riscos/gui/button_bar.c @@ -138,7 +138,7 @@ struct button_bar *ro_gui_button_bar_create(struct theme_descriptor *theme, button_bar = malloc(sizeof(struct button_bar)); if (button_bar == NULL) { - LOG("No memory for malloc()"); + NSLOG(netsurf, INFO, "No memory for malloc()"); return NULL; } @@ -538,7 +538,10 @@ bool ro_gui_button_bar_icon_update(struct button_bar *button_bar) error = xwimp_create_icon(&icon, &button->icon); if (error) { - LOG("xwimp_create_icon: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, + "xwimp_create_icon: 0x%x: %s", + error->errnum, + error->errmess); ro_warn_user("WimpError", error->errmess); button->icon = -1; return false; @@ -548,7 +551,10 @@ bool ro_gui_button_bar_icon_update(struct button_bar *button_bar) error = xwimp_delete_icon(button_bar->window, button->icon); if (error != NULL) { - LOG("xwimp_delete_icon: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, + "xwimp_delete_icon: 0x%x: %s", + error->errnum, + error->errmess); ro_warn_user("WimpError", error->errmess); return false; } @@ -598,7 +604,10 @@ bool ro_gui_button_bar_icon_resize(struct button_bar *button_bar) button->y_pos + button->y_size); if (error != NULL) { - LOG("xwimp_resize_icon: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, + "xwimp_resize_icon: 0x%x: %s", + error->errnum, + error->errmess); ro_warn_user("WimpError", error->errmess); button->icon = -1; return false; @@ -769,7 +778,10 @@ bool ro_gui_button_bar_click(struct button_bar *button_bar, button_bar->sprites, sprite, &box, NULL); if (error) - LOG("xdragasprite_start: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, + "xdragasprite_start: 0x%x: %s", + error->errnum, + error->errmess); ro_mouse_drag_start(ro_gui_button_bar_drag_end, NULL, NULL, NULL); @@ -870,7 +882,8 @@ void ro_gui_button_bar_drag_end(wimp_dragged *drag, void *data) error = xwimp_get_pointer_info(&pointer); if (error) { - LOG("xwimp_get_pointer_info: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_get_pointer_info: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); return; } @@ -880,7 +893,8 @@ void ro_gui_button_bar_drag_end(wimp_dragged *drag, void *data) state.w = drag_start->window; error = xwimp_get_window_state(&state); if (error) { - LOG("xwimp_get_window_state: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_get_window_state: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); return; } @@ -1068,7 +1082,7 @@ char *ro_gui_button_bar_get_config(struct button_bar *button_bar) config = malloc(size); if (config == NULL) { - LOG("No memory for malloc()"); + NSLOG(netsurf, INFO, "No memory for malloc()"); ro_warn_user("NoMemory", 0); return NULL; } diff --git a/frontends/riscos/gui/progress_bar.c b/frontends/riscos/gui/progress_bar.c index c47c2af7d..06d89dbf4 100644 --- a/frontends/riscos/gui/progress_bar.c +++ b/frontends/riscos/gui/progress_bar.c @@ -137,7 +137,8 @@ struct progress_bar *ro_gui_progress_bar_create(void) error = xwimp_create_window((wimp_window *)&progress_bar_definition, &pb->w); if (error) { - LOG("xwimp_create_window: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_create_window: 0x%x: %s", + error->errnum, error->errmess); free(pb); return NULL; } @@ -165,7 +166,8 @@ void ro_gui_progress_bar_destroy(struct progress_bar *pb) ro_gui_wimp_event_finalise(pb->w); error = xwimp_delete_window(pb->w); if (error) { - LOG("xwimp_delete_window: 0x%x:%s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_delete_window: 0x%x:%s", + error->errnum, error->errmess); } free(pb); @@ -327,7 +329,8 @@ void ro_gui_progress_bar_update(struct progress_bar *pb, int width, int height) redraw.box.x0 = cur.x1; error = xwimp_update_window(&redraw, &more); if (error) { - LOG("Error getting update window: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "Error getting update window: 0x%x: %s", + error->errnum, error->errmess); return; } if (more) @@ -351,7 +354,8 @@ void ro_gui_progress_bar_redraw(wimp_draw *redraw) error = xwimp_redraw_window(redraw, &more); if (error) { - LOG("xwimp_redraw_window: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_redraw_window: 0x%x: %s", + error->errnum, error->errmess); return; } if (more) @@ -385,7 +389,8 @@ void ro_gui_progress_bar_animate(void *p) redraw.box = pb->visible; error = xwimp_update_window(&redraw, &more); if (error != NULL) { - LOG("Error getting update window: '%s'", error->errmess); + NSLOG(netsurf, INFO, "Error getting update window: '%s'", + error->errmess); return; } if (more) @@ -533,7 +538,8 @@ void ro_gui_progress_bar_redraw_window(wimp_draw *redraw, } error = xwimp_get_rectangle(redraw, &more); if (error) { - LOG("xwimp_get_rectangle: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_get_rectangle: 0x%x: %s", + error->errnum, error->errmess); return; } } diff --git a/frontends/riscos/gui/status_bar.c b/frontends/riscos/gui/status_bar.c index bcaf3baf9..dd1aab639 100644 --- a/frontends/riscos/gui/status_bar.c +++ b/frontends/riscos/gui/status_bar.c @@ -131,7 +131,8 @@ struct status_bar *ro_gui_status_bar_create(wimp_w parent, unsigned int width) error = xwimp_create_window((wimp_window *)&status_bar_definition, &sb->w); if (error) { - LOG("xwimp_create_window: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_create_window: 0x%x: %s", + error->errnum, error->errmess); free(sb); return NULL; } @@ -165,7 +166,8 @@ void ro_gui_status_bar_destroy(struct status_bar *sb) ro_gui_wimp_event_finalise(sb->w); error = xwimp_delete_window(sb->w); if (error) { - LOG("xwimp_delete_window: 0x%x:%s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_delete_window: 0x%x:%s", + error->errnum, error->errmess); } ro_gui_progress_bar_destroy(sb->pb); @@ -222,7 +224,8 @@ void ro_gui_status_bar_set_visible(struct status_bar *sb, bool visible) } else { os_error *error = xwimp_close_window(sb->w); if (error) { - LOG("xwimp_close_window: 0x%x:%s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_close_window: 0x%x:%s", + error->errnum, error->errmess); } } } @@ -275,14 +278,15 @@ void ro_gui_status_bar_set_progress_range(struct status_bar *sb, old_range = ro_gui_progress_bar_get_range(sb->pb); ro_gui_progress_bar_set_range(sb->pb, range); - LOG("Ranges are %i vs %i", old_range, range); + NSLOG(netsurf, INFO, "Ranges are %i vs %i", old_range, range); if ((old_range == 0) && (range != 0)) { ro_gui_status_position_progress_bar(sb); } else if ((old_range != 0) && (range == 0)) { os_error *error = xwimp_close_window( ro_gui_progress_bar_get_window(sb->pb)); if (error) { - LOG("xwimp_close_window: 0x%x:%s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_close_window: 0x%x:%s", + error->errnum, error->errmess); } } } @@ -354,7 +358,8 @@ void ro_gui_status_bar_resize(struct status_bar *sb) state.w = sb->parent; error = xwimp_get_window_state(&state); if (error) { - LOG("xwimp_get_window_state: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_get_window_state: 0x%x: %s", + error->errnum, error->errmess); return; } window_width = state.visible.x1 - state.visible.x0; @@ -377,7 +382,8 @@ void ro_gui_status_bar_resize(struct status_bar *sb) extent.y1 = status_height - 4; error = xwimp_set_extent(sb->w, &extent); if (error) { - LOG("xwimp_set_extent: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_set_extent: 0x%x: %s", + error->errnum, error->errmess); return; } @@ -405,7 +411,10 @@ void ro_gui_status_bar_resize(struct status_bar *sb) wimp_CHILD_LINKS_PARENT_VISIBLE_BOTTOM_OR_LEFT << wimp_CHILD_TS_EDGE_SHIFT); if (error) { - LOG("xwimp_open_window_nested: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, + "xwimp_open_window_nested: 0x%x: %s", + error->errnum, + error->errmess); return; } ro_gui_status_position_progress_bar(sb); @@ -413,7 +422,8 @@ void ro_gui_status_bar_resize(struct status_bar *sb) status_width - WIDGET_WIDTH, 0, status_width, status_height - 4); if (error) { - LOG("xwimp_resize_icon: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_resize_icon: 0x%x: %s", + error->errnum, error->errmess); return; } @@ -454,7 +464,8 @@ void ro_gui_status_bar_redraw(wimp_draw *redraw) /* redraw the window */ error = xwimp_redraw_window(redraw, &more); if (error) { - LOG("xwimp_redraw_window: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_redraw_window: 0x%x: %s", + error->errnum, error->errmess); return; } while (more) { @@ -463,7 +474,10 @@ void ro_gui_status_bar_redraw(wimp_draw *redraw) error = xcolourtrans_set_font_colours(font_CURRENT, 0xeeeeee00, 0x00000000, 14, 0, 0, 0); if (error) { - LOG("xcolourtrans_set_font_colours: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, + "xcolourtrans_set_font_colours: 0x%x: %s", + error->errnum, + error->errmess); return; } code = rufl_paint(ro_gui_desktop_font_family, @@ -474,10 +488,13 @@ void ro_gui_status_bar_redraw(wimp_draw *redraw) rufl_BLEND_FONT); if (code != rufl_OK) { if (code == rufl_FONT_MANAGER_ERROR) - LOG("rufl_FONT_MANAGER_ERROR: 0x%x: %s", - rufl_fm_error->errnum, rufl_fm_error->errmess); + NSLOG(netsurf, INFO, + "rufl_FONT_MANAGER_ERROR: 0x%x: %s", + rufl_fm_error->errnum, + rufl_fm_error->errmess); else - LOG("rufl_paint: 0x%x", code); + NSLOG(netsurf, INFO, + "rufl_paint: 0x%x", code); } } @@ -493,7 +510,8 @@ void ro_gui_status_bar_redraw(wimp_draw *redraw) error = xwimp_get_rectangle(redraw, &more); if (error) { - LOG("xwimp_get_rectangle: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_get_rectangle: 0x%x: %s", + error->errnum, error->errmess); return; } } @@ -532,7 +550,10 @@ bool ro_gui_status_bar_click(wimp_pointer *pointer) drag.initial.y1 = pointer->pos.y; error = xwimp_drag_box(&drag); if (error) { - LOG("xwimp_drag_box: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, + "xwimp_drag_box: 0x%x: %s", + error->errnum, + error->errmess); } break; } @@ -557,7 +578,8 @@ void ro_gui_status_bar_open(wimp_open *open) state.w = sb->parent; error = xwimp_get_window_state(&state); if (error) { - LOG("xwimp_get_window_state: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_get_window_state: 0x%x: %s", + error->errnum, error->errmess); return; } window_width = state.visible.x1 - state.visible.x0; @@ -596,7 +618,8 @@ void ro_gui_status_position_progress_bar(struct status_bar *sb) state.w = sb->w; error = xwimp_get_window_state(&state); if (error) { - LOG("xwimp_get_window_state: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_get_window_state: 0x%x: %s", + error->errnum, error->errmess); return; } @@ -626,7 +649,8 @@ void ro_gui_status_position_progress_bar(struct status_bar *sb) wimp_CHILD_LINKS_PARENT_VISIBLE_BOTTOM_OR_LEFT << wimp_CHILD_TS_EDGE_SHIFT); if (error) { - LOG("xwimp_open_window: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_open_window: 0x%x: %s", + error->errnum, error->errmess); } /* update the progress bar display on non-standard width */ diff --git a/frontends/riscos/gui/throbber.c b/frontends/riscos/gui/throbber.c index a326f806c..f3b79a68e 100644 --- a/frontends/riscos/gui/throbber.c +++ b/frontends/riscos/gui/throbber.c @@ -81,7 +81,7 @@ struct throbber *ro_gui_throbber_create(struct theme_descriptor *theme) throbber = malloc(sizeof(struct throbber)); if (throbber == NULL) { - LOG("No memory for malloc()"); + NSLOG(netsurf, INFO, "No memory for malloc()"); return NULL; } @@ -248,7 +248,8 @@ bool ro_gui_throbber_icon_update(struct throbber *throbber) error = xwimp_create_icon(&icon, &throbber->icon); if (error != NULL) { - LOG("xwimp_create_icon: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_create_icon: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); throbber->icon = -1; return false; @@ -259,7 +260,8 @@ bool ro_gui_throbber_icon_update(struct throbber *throbber) } else if (throbber->hidden && throbber->icon != -1) { error = xwimp_delete_icon(throbber->window, throbber->icon); if (error != NULL) { - LOG("xwimp_delete_icon: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_delete_icon: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); return false; } @@ -295,7 +297,8 @@ bool ro_gui_throbber_icon_resize(struct throbber *throbber) throbber->extent.x0, throbber->extent.y0, throbber->extent.x1, throbber->extent.y1); if (error != NULL) { - LOG("xwimp_resize_icon: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_resize_icon: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); throbber->icon = -1; return false; diff --git a/frontends/riscos/gui/url_bar.c b/frontends/riscos/gui/url_bar.c index a5ec3f8c6..ee5c689df 100644 --- a/frontends/riscos/gui/url_bar.c +++ b/frontends/riscos/gui/url_bar.c @@ -140,7 +140,7 @@ struct url_bar *ro_gui_url_bar_create(struct theme_descriptor *theme) url_bar = malloc(sizeof(struct url_bar)); if (url_bar == NULL) { - LOG("No memory for malloc()"); + NSLOG(netsurf, INFO, "No memory for malloc()"); return NULL; } @@ -240,7 +240,8 @@ static bool ro_gui_url_bar_icon_resize(struct url_bar *url_bar, bool full) url_bar->container_icon, x0, y0, x1, y1); if (error != NULL) { - LOG("xwimp_resize_icon: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_resize_icon: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); url_bar->container_icon = -1; return false; @@ -260,7 +261,8 @@ static bool ro_gui_url_bar_icon_resize(struct url_bar *url_bar, bool full) url_bar->suggest_icon, x0, y0, x1, y1); if (error != NULL) { - LOG("xwimp_resize_icon: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_resize_icon: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); url_bar->suggest_icon = -1; return false; @@ -281,7 +283,8 @@ static bool ro_gui_url_bar_icon_resize(struct url_bar *url_bar, bool full) url_bar->text_icon, x0, y0, x1, y1); if (error != NULL) { - LOG("xwimp_resize_icon: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_resize_icon: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); url_bar->text_icon = -1; return false; @@ -362,7 +365,8 @@ static bool ro_gui_url_bar_icon_update(struct url_bar *url_bar) wimp_ICON_BUTTON_TYPE_SHIFT); error = xwimp_create_icon(&icon, &url_bar->container_icon); if (error != NULL) { - LOG("xwimp_create_icon: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_create_icon: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); url_bar->container_icon = -1; return false; @@ -373,7 +377,8 @@ static bool ro_gui_url_bar_icon_update(struct url_bar *url_bar) error = xwimp_delete_icon(url_bar->window, url_bar->container_icon); if (error != NULL) { - LOG("xwimp_delete_icon: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_delete_icon: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); return false; } @@ -399,7 +404,8 @@ static bool ro_gui_url_bar_icon_update(struct url_bar *url_bar) wimp_ICON_BUTTON_TYPE_SHIFT); error = xwimp_create_icon(&icon, &url_bar->text_icon); if (error) { - LOG("xwimp_create_icon: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_create_icon: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); url_bar->text_icon = -1; return false; @@ -410,7 +416,8 @@ static bool ro_gui_url_bar_icon_update(struct url_bar *url_bar) error = xwimp_delete_icon(url_bar->window, url_bar->text_icon); if (error != NULL) { - LOG("xwimp_delete_icon: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_delete_icon: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); return false; } @@ -430,7 +437,8 @@ static bool ro_gui_url_bar_icon_update(struct url_bar *url_bar) wimp_ICON_BUTTON_TYPE_SHIFT); error = xwimp_create_icon(&icon, &url_bar->suggest_icon); if (error) { - LOG("xwimp_create_icon: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_create_icon: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); return false; } @@ -450,7 +458,8 @@ static bool ro_gui_url_bar_icon_update(struct url_bar *url_bar) error = xwimp_delete_icon(url_bar->window, url_bar->suggest_icon); if (error != NULL) { - LOG("xwimp_delete_icon: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_delete_icon: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); return false; } @@ -940,7 +949,8 @@ bool ro_gui_url_bar_take_caret(struct url_bar *url_bar) error = xwimp_set_caret_position(url_bar->window, url_bar->text_icon, -1, -1, -1, 0); if (error) { - LOG("xwimp_set_caret_position: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_set_caret_position: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); return false; @@ -977,7 +987,7 @@ void ro_gui_url_bar_set_url(struct url_bar *url_bar, const char *url, if (err != NSERROR_OK) { /* A bad encoding should never happen, so assert this */ assert(err != NSERROR_BAD_ENCODING); - LOG("utf8_to_enc failed"); + NSLOG(netsurf, INFO, "utf8_to_enc failed"); /* Paranoia */ local_text = NULL; } @@ -993,7 +1003,8 @@ void ro_gui_url_bar_set_url(struct url_bar *url_bar, const char *url, if (strlen(local_url) >= url_bar->text_size) { url_bar->text_buffer[0] = '\0'; ro_warn_user("LongURL", NULL); - LOG("Long URL (%zu chars): %s", strlen(url), url); + NSLOG(netsurf, INFO, "Long URL (%zu chars): %s", strlen(url), + url); } else { strncpy(url_bar->text_buffer, local_url, url_bar->text_size - 1); @@ -1021,7 +1032,8 @@ void ro_gui_url_bar_set_url(struct url_bar *url_bar, const char *url, error = xwimp_get_caret_position(&caret); if (error) { - LOG("xwimp_get_caret_position: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_get_caret_position: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); return; } @@ -1034,7 +1046,10 @@ void ro_gui_url_bar_set_url(struct url_bar *url_bar, const char *url, error = xwimp_set_caret_position(url_bar->window, url_bar->text_icon, 0, 0, -1, strlen(set_url)); if (error) { - LOG("xwimp_set_caret_position: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, + "xwimp_set_caret_position: 0x%x: %s", + error->errnum, + error->errmess); ro_warn_user("WimpError", error->errmess); } } @@ -1123,7 +1138,8 @@ bool ro_gui_url_bar_get_url_extent(struct url_bar *url_bar, os_box *extent) state.i = url_bar->container_icon; error = xwimp_get_icon_state(&state); if (error) { - LOG("xwimp_get_icon_state: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_get_icon_state: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); return false; } diff --git a/frontends/riscos/help.c b/frontends/riscos/help.c index b6871c5eb..952b3f2d1 100644 --- a/frontends/riscos/help.c +++ b/frontends/riscos/help.c @@ -166,7 +166,8 @@ void ro_gui_interactive_help_request(wimp_message *message) error = xwimp_get_menu_state(wimp_GIVEN_WINDOW_AND_ICON, &menu_tree, window, icon); if (error) { - LOG("xwimp_get_menu_state: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_get_menu_state: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); return; } @@ -269,7 +270,8 @@ static void ro_gui_interactive_help_broadcast(wimp_message *message, error = xwimp_send_message(wimp_USER_MESSAGE, (wimp_message *)reply, reply->sender); if (error) { - LOG("xwimp_send_message: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_send_message: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); } } @@ -297,7 +299,10 @@ bool ro_gui_interactive_help_available(void) error = xtaskmanager_enumerate_tasks(context, &task, sizeof(taskmanager_task), &context, 0); if (error) { - LOG("xtaskmanager_enumerate_tasks: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, + "xtaskmanager_enumerate_tasks: 0x%x: %s", + error->errnum, + error->errmess); ro_warn_user("MiscError", error->errmess); } @@ -334,7 +339,8 @@ void ro_gui_interactive_help_start(void) if ((help_start) && (help_start[0])) { error = xwimp_start_task("", &task); if (error) { - LOG("xwimp_start_tast: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_start_tast: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); return; } @@ -344,7 +350,8 @@ void ro_gui_interactive_help_start(void) if (!task) { error = xwimp_start_task("Resources:$.Apps.!Help", &task); if (error) { - LOG("xwimp_start_tast: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_start_tast: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); return; } @@ -354,7 +361,10 @@ void ro_gui_interactive_help_start(void) if (task) { error = xos_read_monotonic_time(&help_time); if (error) { - LOG("xwimp_read_monotonic_time: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, + "xwimp_read_monotonic_time: 0x%x: %s", + error->errnum, + error->errmess); ro_warn_user("WimpError", error->errmess); } } diff --git a/frontends/riscos/hotlist.c b/frontends/riscos/hotlist.c index b055d1bec..b0ed1e2f4 100644 --- a/frontends/riscos/hotlist.c +++ b/frontends/riscos/hotlist.c @@ -548,19 +548,20 @@ nserror ro_gui_hotlist_present(void) return NSERROR_OK; } - LOG("xos_cli: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xos_cli: 0x%x: %s", error->errnum, + error->errmess); ro_warn_user("Failed to launch external hotlist: %s", error->errmess); } res = ro_hotlist_init(); if (res == NSERROR_OK) { - LOG("Presenting"); + NSLOG(netsurf, INFO, "Presenting"); ro_gui_dialog_open_top(hotlist_window->core.wh, hotlist_window->core.toolbar, 600, 800); } else { - LOG("Failed presenting code %d", res); + NSLOG(netsurf, INFO, "Failed presenting code %d", res); } return res; diff --git a/frontends/riscos/iconbar.c b/frontends/riscos/iconbar.c index 3430ed2f0..23f97258b 100644 --- a/frontends/riscos/iconbar.c +++ b/frontends/riscos/iconbar.c @@ -95,7 +95,8 @@ void ro_gui_iconbar_initialise(void) { "!netsurf" } } }; error = xwimp_create_icon(&icon, 0); if (error) { - LOG("xwimp_create_icon: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_create_icon: 0x%x: %s", + error->errnum, error->errmess); die(error->errmess); } @@ -238,7 +239,8 @@ bool ro_gui_iconbar_menu_select(wimp_w w, wimp_i i, wimp_menu *menu, return true; case APPLICATION_QUIT: if (ro_gui_prequit()) { - LOG("QUIT in response to user request"); + NSLOG(netsurf, INFO, + "QUIT in response to user request"); riscos_done = true; } return true; diff --git a/frontends/riscos/image.c b/frontends/riscos/image.c index acbe62d98..30cb30096 100644 --- a/frontends/riscos/image.c +++ b/frontends/riscos/image.c @@ -142,7 +142,8 @@ bool image_redraw_tinct(osspriteop_id header, int x, int y, } if (error) { - LOG("xtinct_plotscaled%s: 0x%x: %s", (alpha ? "alpha" : ""), error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xtinct_plotscaled%s: 0x%x: %s", + (alpha ? "alpha" : ""), error->errnum, error->errmess); return false; } @@ -176,13 +177,16 @@ bool image_redraw_os(osspriteop_id header, int x, int y, int req_width, colourtrans_CURRENT_PALETTE, 0, colourtrans_GIVEN_SPRITE, 0, 0, &size); if (error) { - LOG("xcolourtrans_generate_table_for_sprite: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, + "xcolourtrans_generate_table_for_sprite: 0x%x: %s", + error->errnum, + error->errmess); return false; } table = calloc(size, sizeof(char)); if (!table) { - LOG("malloc failed"); + NSLOG(netsurf, INFO, "malloc failed"); ro_warn_user("NoMemory", 0); return false; } @@ -193,7 +197,10 @@ bool image_redraw_os(osspriteop_id header, int x, int y, int req_width, colourtrans_CURRENT_PALETTE, table, colourtrans_GIVEN_SPRITE, 0, 0, 0); if (error) { - LOG("xcolourtrans_generate_table_for_sprite: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, + "xcolourtrans_generate_table_for_sprite: 0x%x: %s", + error->errnum, + error->errmess); free(table); return false; } @@ -208,7 +215,10 @@ bool image_redraw_os(osspriteop_id header, int x, int y, int req_width, x, (int)(y - req_height), 8, &f, table); if (error) { - LOG("xosspriteop_put_sprite_scaled: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, + "xosspriteop_put_sprite_scaled: 0x%x: %s", + error->errnum, + error->errmess); free(table); return false; } diff --git a/frontends/riscos/local_history.c b/frontends/riscos/local_history.c index f9f1f2e01..bbe6a1d12 100644 --- a/frontends/riscos/local_history.c +++ b/frontends/riscos/local_history.c @@ -154,8 +154,8 @@ ro_local_history_tooltip(struct ro_local_history_window *lhw, int x, int y) /* not over a tree entry => close tooltip window. */ error = xwimp_close_window(dialog_tooltip); if (error) { - LOG("xwimp_close_window: 0x%x: %s", - error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_close_window: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); return NSERROR_NOMEM; } @@ -167,8 +167,8 @@ ro_local_history_tooltip(struct ro_local_history_window *lhw, int x, int y) nsurl_length(url) > 256 ? 256 : nsurl_length(url), &width); if (error) { - LOG("xwimptextop_string_width: 0x%x: %s", - error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimptextop_string_width: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); nsurl_unref(url); return NSERROR_NOMEM; @@ -182,8 +182,8 @@ ro_local_history_tooltip(struct ro_local_history_window *lhw, int x, int y) ic.i = 0; error = xwimp_get_icon_state(&ic); if (error) { - LOG("xwimp_get_icon_state: 0x%x: %s", - error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_get_icon_state: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); return NSERROR_NOMEM; } @@ -191,8 +191,8 @@ ro_local_history_tooltip(struct ro_local_history_window *lhw, int x, int y) ic.icon.extent.x0, ic.icon.extent.y0, width + 16, ic.icon.extent.y1); if (error) { - LOG("xwimp_resize_icon: 0x%x: %s", - error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_resize_icon: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); return NSERROR_NOMEM; } @@ -200,8 +200,8 @@ ro_local_history_tooltip(struct ro_local_history_window *lhw, int x, int y) state.w = dialog_tooltip; error = xwimp_get_window_state(&state); if (error) { - LOG("xwimp_get_window_state: 0x%x: %s", - error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_get_window_state: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); return NSERROR_NOMEM; } @@ -211,15 +211,16 @@ ro_local_history_tooltip(struct ro_local_history_window *lhw, int x, int y) box.y0 = -36; error = xwimp_set_extent(dialog_tooltip, &box); if (error) { - LOG("xwimp_set_extent: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_set_extent: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); return NSERROR_NOMEM; } error = xwimp_get_pointer_info(&pointer); if (error) { - LOG("xwimp_get_pointer_info: 0x%x: %s", - error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_get_pointer_info: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); return NSERROR_NOMEM; } @@ -233,8 +234,8 @@ ro_local_history_tooltip(struct ro_local_history_window *lhw, int x, int y) /* open window */ error = xwimp_open_window(PTR_WIMP_OPEN(&state)); if (error) { - LOG("xwimp_open_window: 0x%x: %s", - error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_open_window: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); return NSERROR_NOMEM; } @@ -363,8 +364,8 @@ ro_local_history_open(struct ro_local_history_window *lhw, wimp_w parent) box.y0 = -height; error = xwimp_set_extent(lhw->core.wh, &box); if (error) { - LOG("xwimp_set_extent: 0x%x: %s", - error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_set_extent: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); return NSERROR_NOMEM; } @@ -373,8 +374,8 @@ ro_local_history_open(struct ro_local_history_window *lhw, wimp_w parent) state.w = lhw->core.wh; error = xwimp_get_window_state(&state); if (error) { - LOG("xwimp_get_window_state: 0x%x: %s", - error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_get_window_state: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); return NSERROR_NOMEM; } @@ -385,8 +386,8 @@ ro_local_history_open(struct ro_local_history_window *lhw, wimp_w parent) state.next = wimp_HIDDEN; error = xwimp_open_window(PTR_WIMP_OPEN(&state)); if (error) { - LOG("xwimp_open_window: 0x%x: %s", - error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_open_window: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); return NSERROR_NOMEM; } @@ -403,10 +404,10 @@ nserror ro_gui_local_history_present(wimp_w parent, struct browser_window *bw) res = ro_local_history_init(bw, &local_history_window); if (res == NSERROR_OK) { - LOG("Presenting"); + NSLOG(netsurf, INFO, "Presenting"); res = ro_local_history_open(local_history_window, parent); } else { - LOG("Failed presenting error code %d", res); + NSLOG(netsurf, INFO, "Failed presenting error code %d", res); } return res; diff --git a/frontends/riscos/menus.c b/frontends/riscos/menus.c index d46afa28e..a6e978a6c 100644 --- a/frontends/riscos/menus.c +++ b/frontends/riscos/menus.c @@ -232,7 +232,8 @@ void ro_gui_menu_create(wimp_menu *menu, int x, int y, wimp_w w) current_menu_open = true; error = xwimp_create_menu(menu, x - 64, y); if (error) { - LOG("xwimp_create_menu: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_create_menu: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("MenuError", error->errmess); ro_gui_menu_closed(); } @@ -258,14 +259,16 @@ void ro_gui_popup_menu(wimp_menu *menu, wimp_w w, wimp_i i) icon_state.i = i; error = xwimp_get_window_state(&state); if (error) { - LOG("xwimp_get_window_state: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_get_window_state: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("MenuError", error->errmess); return; } error = xwimp_get_icon_state(&icon_state); if (error) { - LOG("xwimp_get_icon_state: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_get_icon_state: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("MenuError", error->errmess); return; } @@ -291,7 +294,8 @@ void ro_gui_menu_destroy(void) error = xwimp_create_menu(wimp_CLOSE_MENU, 0, 0); if (error) { - LOG("xwimp_create_menu: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_create_menu: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("MenuError", error->errmess); } @@ -354,7 +358,8 @@ void ro_gui_menu_selection(wimp_selection *selection) /* re-open the menu for Adjust clicks */ error = xwimp_get_pointer_info(&pointer); if (error) { - LOG("xwimp_get_pointer_info: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_get_pointer_info: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); ro_gui_menu_closed(); return; @@ -420,7 +425,8 @@ void ro_gui_menu_warning(wimp_message_menu_warning *warning) error = xwimp_create_sub_menu(menu_entry->sub_menu, warning->pos.x, warning->pos.y); if (error) { - LOG("xwimp_create_sub_menu: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_create_sub_menu: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("MenuError", error->errmess); } } @@ -485,7 +491,8 @@ void ro_gui_menu_refresh(wimp_menu *menu) os_error *error; error = xwimp_create_menu(current_menu, 0, 0); if (error) { - LOG("xwimp_create_menu: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_create_menu: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("MenuError", error->errmess); } } @@ -851,7 +858,8 @@ int ro_gui_menu_get_checksum(void) error = xwimp_get_menu_state((wimp_menu_state_flags)0, &menu_tree, 0, 0); if (error) { - LOG("xwimp_get_menu_state: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_get_menu_state: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("MenuError", error->errmess); return 0; } @@ -894,7 +902,8 @@ bool ro_gui_menu_translate(struct menu_definition *menu) /* read current alphabet */ error = xosbyte1(osbyte_ALPHABET_NUMBER, 127, 0, &alphabet); if (error) { - LOG("failed reading alphabet: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "failed reading alphabet: 0x%x: %s", + error->errnum, error->errmess); /* assume Latin1 */ alphabet = territory_ALPHABET_LATIN1; } @@ -909,7 +918,7 @@ bool ro_gui_menu_translate(struct menu_definition *menu) 0, &translated); if (err != NSERROR_OK) { assert(err != NSERROR_BAD_ENCODING); - LOG("utf8_to_enc failed"); + NSLOG(netsurf, INFO, "utf8_to_enc failed"); return false; } @@ -926,7 +935,7 @@ bool ro_gui_menu_translate(struct menu_definition *menu) 0, &translated); if (err != NSERROR_OK) { assert(err != NSERROR_BAD_ENCODING); - LOG("utf8_to_enc failed"); + NSLOG(netsurf, INFO, "utf8_to_enc failed"); return false; } diff --git a/frontends/riscos/message.c b/frontends/riscos/message.c index 1c54ea0b7..7a0216185 100644 --- a/frontends/riscos/message.c +++ b/frontends/riscos/message.c @@ -64,7 +64,8 @@ bool ro_message_send_message(wimp_event_no event, wimp_message *message, /* send a message */ error = xwimp_send_message(event, message, task); if (error) { - LOG("xwimp_send_message: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_send_message: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); return false; } @@ -101,7 +102,10 @@ bool ro_message_send_message_to_window(wimp_event_no event, wimp_message *messag /* send a message */ error = xwimp_send_message_to_window(event, message, to_w, to_i, to_t); if (error) { - LOG("xwimp_send_message_to_window: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, + "xwimp_send_message_to_window: 0x%x: %s", + error->errnum, + error->errmess); ro_warn_user("WimpError", error->errmess); return false; } diff --git a/frontends/riscos/mouse.c b/frontends/riscos/mouse.c index a0cc0e7ce..89184cff3 100644 --- a/frontends/riscos/mouse.c +++ b/frontends/riscos/mouse.c @@ -81,7 +81,8 @@ void ro_mouse_poll(void) error = xwimp_get_pointer_info(&pointer); if (error) { - LOG("xwimp_get_pointer_info: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_get_pointer_info: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); return; } @@ -194,7 +195,7 @@ void ro_mouse_track_start(void (*poll_end)(wimp_leaving *leaving, void *data), ro_mouse_ignore_leaving_event == false) ro_mouse_poll_end_callback(NULL, ro_mouse_poll_data); - LOG("Unexpected mouse track termination."); + NSLOG(netsurf, INFO, "Unexpected mouse track termination."); ro_mouse_ignore_leaving_event = false; ro_mouse_poll_end_callback = NULL; diff --git a/frontends/riscos/plotters.c b/frontends/riscos/plotters.c index b459ba1f9..2fbd12aeb 100644 --- a/frontends/riscos/plotters.c +++ b/frontends/riscos/plotters.c @@ -79,15 +79,16 @@ ro_plot_draw_path(const draw_path * const path, error = xcolourtrans_set_gcol(c << 8, 0, os_ACTION_OVERWRITE, 0, 0); if (error) { - LOG("xcolourtrans_set_gcol: 0x%x: %s", - error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xcolourtrans_set_gcol: 0x%x: %s", + error->errnum, error->errmess); return NSERROR_INVALID; } error = xdraw_stroke(path, 0, 0, 0, width * 2 * 256, &line_style, dash_pattern); if (error) { - LOG("xdraw_stroke: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xdraw_stroke: 0x%x: %s", error->errnum, + error->errmess); return NSERROR_INVALID; } @@ -115,8 +116,8 @@ ro_plot_clip(const struct redraw_context *ctx, const struct rect *clip) int clip_y1 = ro_plot_origin_y - clip->y1 * 2; if (clip_x1 < clip_x0 || clip_y0 < clip_y1) { - LOG("bad clip rectangle %i %i %i %i", - clip_x0, clip_y0, clip_x1, clip_y1); + NSLOG(netsurf, INFO, "bad clip rectangle %i %i %i %i", + clip_x0, clip_y0, clip_x1, clip_y1); return NSERROR_BAD_SIZE; } @@ -132,7 +133,8 @@ ro_plot_clip(const struct redraw_context *ctx, const struct rect *clip) error = xos_writen(buf, 9); if (error) { - LOG("xos_writen: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xos_writen: 0x%x: %s", error->errnum, + error->errmess); return NSERROR_INVALID; } @@ -173,8 +175,8 @@ ro_plot_arc(const struct redraw_context *ctx, os_ACTION_OVERWRITE, 0, 0); if (error) { - LOG("xcolourtrans_set_gcol: 0x%x: %s", - error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xcolourtrans_set_gcol: 0x%x: %s", + error->errnum, error->errmess); return NSERROR_INVALID; } @@ -188,19 +190,22 @@ ro_plot_arc(const struct redraw_context *ctx, error = xos_plot(os_MOVE_TO, x, y); /* move to centre */ if (error) { - LOG("xos_plot: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xos_plot: 0x%x: %s", error->errnum, + error->errmess); return NSERROR_INVALID; } error = xos_plot(os_MOVE_TO, sx, sy); /* move to start */ if (error) { - LOG("xos_plot: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xos_plot: 0x%x: %s", error->errnum, + error->errmess); return NSERROR_INVALID; } error = xos_plot(os_PLOT_ARC | os_PLOT_TO, ex, ey); /* arc to end */ if (error) { - LOG("xos_plot: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xos_plot: 0x%x: %s", error->errnum, + error->errmess); return NSERROR_INVALID; } @@ -230,20 +235,24 @@ ro_plot_disc(const struct redraw_context *ctx, error = xcolourtrans_set_gcol(style->fill_colour << 8, 0, os_ACTION_OVERWRITE, 0, 0); if (error) { - LOG("xcolourtrans_set_gcol: 0x%x: %s", - error->errnum, error->errmess); + NSLOG(netsurf, INFO, + "xcolourtrans_set_gcol: 0x%x: %s", + error->errnum, + error->errmess); return NSERROR_INVALID; } error = xos_plot(os_MOVE_TO, ro_plot_origin_x + x * 2, ro_plot_origin_y - y * 2); if (error) { - LOG("xos_plot: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xos_plot: 0x%x: %s", + error->errnum, error->errmess); return NSERROR_INVALID; } error = xos_plot(os_PLOT_CIRCLE | os_PLOT_BY, radius * 2, 0); if (error) { - LOG("xos_plot: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xos_plot: 0x%x: %s", + error->errnum, error->errmess); return NSERROR_INVALID; } } @@ -253,22 +262,26 @@ ro_plot_disc(const struct redraw_context *ctx, error = xcolourtrans_set_gcol(style->stroke_colour << 8, 0, os_ACTION_OVERWRITE, 0, 0); if (error) { - LOG("xcolourtrans_set_gcol: 0x%x: %s", - error->errnum, error->errmess); + NSLOG(netsurf, INFO, + "xcolourtrans_set_gcol: 0x%x: %s", + error->errnum, + error->errmess); return NSERROR_INVALID; } error = xos_plot(os_MOVE_TO, ro_plot_origin_x + x * 2, ro_plot_origin_y - y * 2); if (error) { - LOG("xos_plot: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xos_plot: 0x%x: %s", + error->errnum, error->errmess); return NSERROR_INVALID; } error = xos_plot(os_PLOT_CIRCLE_OUTLINE | os_PLOT_BY, radius * 2, 0); if (error) { - LOG("xos_plot: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xos_plot: 0x%x: %s", + error->errnum, error->errmess); return NSERROR_INVALID; } } @@ -343,8 +356,10 @@ ro_plot_rectangle(const struct redraw_context *ctx, colourtrans_USE_ECFS_GCOL, os_ACTION_OVERWRITE, 0, 0); if (error) { - LOG("xcolourtrans_set_gcol: 0x%x: %s", - error->errnum, error->errmess); + NSLOG(netsurf, INFO, + "xcolourtrans_set_gcol: 0x%x: %s", + error->errnum, + error->errmess); return NSERROR_INVALID; } @@ -352,7 +367,8 @@ ro_plot_rectangle(const struct redraw_context *ctx, ro_plot_origin_x + rect->x0 * 2, ro_plot_origin_y - rect->y0 * 2 - 1); if (error) { - LOG("xos_plot: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xos_plot: 0x%x: %s", + error->errnum, error->errmess); return NSERROR_INVALID; } @@ -360,7 +376,8 @@ ro_plot_rectangle(const struct redraw_context *ctx, ro_plot_origin_x + rect->x1 * 2 - 1, ro_plot_origin_y - rect->y1 * 2); if (error) { - LOG("xos_plot: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xos_plot: 0x%x: %s", + error->errnum, error->errmess); return NSERROR_INVALID; } } @@ -441,13 +458,14 @@ ro_plot_polygon(const struct redraw_context *ctx, error = xcolourtrans_set_gcol(style->fill_colour << 8, 0, os_ACTION_OVERWRITE, 0, 0); if (error) { - LOG("xcolourtrans_set_gcol: 0x%x: %s", - error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xcolourtrans_set_gcol: 0x%x: %s", + error->errnum, error->errmess); return NSERROR_INVALID; } error = xdraw_fill((draw_path *) path, 0, 0, 0); if (error) { - LOG("xdraw_fill: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xdraw_fill: 0x%x: %s", error->errnum, + error->errmess); return NSERROR_INVALID; } @@ -494,13 +512,13 @@ ro_plot_path(const struct redraw_context *ctx, } if (p[0] != PLOTTER_PATH_MOVE) { - LOG("path doesn't start with a move"); + NSLOG(netsurf, INFO, "path doesn't start with a move"); goto error; } path = malloc(sizeof *path * (n + 10)); if (!path) { - LOG("out of memory"); + NSLOG(netsurf, INFO, "out of memory"); goto error; } @@ -528,7 +546,7 @@ ro_plot_path(const struct redraw_context *ctx, path[i + 6] = -p[i + 6] * 2 * 256; i += 7; } else { - LOG("bad path command %f", p[i]); + NSLOG(netsurf, INFO, "bad path command %f", p[i]); goto error; } } @@ -546,15 +564,17 @@ ro_plot_path(const struct redraw_context *ctx, error = xcolourtrans_set_gcol(pstyle->fill_colour << 8, 0, os_ACTION_OVERWRITE, 0, 0); if (error) { - LOG("xcolourtrans_set_gcol: 0x%x: %s", - error->errnum, error->errmess); + NSLOG(netsurf, INFO, + "xcolourtrans_set_gcol: 0x%x: %s", + error->errnum, + error->errmess); goto error; } error = xdraw_fill((draw_path *) path, 0, &trfm, 0); if (error) { - LOG("xdraw_stroke: 0x%x: %s", - error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xdraw_stroke: 0x%x: %s", + error->errnum, error->errmess); goto error; } } @@ -563,16 +583,18 @@ ro_plot_path(const struct redraw_context *ctx, error = xcolourtrans_set_gcol(pstyle->stroke_colour << 8, 0, os_ACTION_OVERWRITE, 0, 0); if (error) { - LOG("xcolourtrans_set_gcol: 0x%x: %s", - error->errnum, error->errmess); + NSLOG(netsurf, INFO, + "xcolourtrans_set_gcol: 0x%x: %s", + error->errnum, + error->errmess); goto error; } error = xdraw_stroke((draw_path *) path, 0, &trfm, 0, width * 2 * 256, &line_style, 0); if (error) { - LOG("xdraw_stroke: 0x%x: %s", - error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xdraw_stroke: 0x%x: %s", + error->errnum, error->errmess); goto error; } } @@ -623,7 +645,7 @@ ro_plot_bitmap(const struct redraw_context *ctx, buffer = riscos_bitmap_get_buffer(bitmap); if (!buffer) { - LOG("bitmap_get_buffer failed"); + NSLOG(netsurf, INFO, "bitmap_get_buffer failed"); return NSERROR_INVALID; } @@ -669,8 +691,10 @@ ro_plot_text(const struct redraw_context *ctx, fstyle->background << 8, fstyle->foreground << 8, 14, 0, 0, 0); if (error) { - LOG("xcolourtrans_set_font_colours: 0x%x: %s", - error->errnum, error->errmess); + NSLOG(netsurf, INFO, + "xcolourtrans_set_font_colours: 0x%x: %s", + error->errnum, + error->errmess); return NSERROR_INVALID; } diff --git a/frontends/riscos/print.c b/frontends/riscos/print.c index b7ddd4e53..d965baff4 100644 --- a/frontends/riscos/print.c +++ b/frontends/riscos/print.c @@ -169,7 +169,8 @@ void ro_gui_print_prepare(struct gui_window *g) /* Read Printer Driver name */ error = xpdriver_info(0, 0, 0, 0, &desc, 0, 0, 0); if (error) { - LOG("xpdriver_info: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xpdriver_info: 0x%x: %s", + error->errnum, error->errmess); printers_exists = false; } @@ -306,7 +307,8 @@ void print_send_printsave(struct hlcache_handle *h) e = xwimp_send_message(wimp_USER_MESSAGE_RECORDED, (wimp_message *)&m, 0); if (e) { - LOG("xwimp_send_message: 0x%x: %s", e->errnum, e->errmess); + NSLOG(netsurf, INFO, "xwimp_send_message: 0x%x: %s", + e->errnum, e->errmess); ro_warn_user("WimpError", e->errmess); ro_print_cleanup(); } @@ -330,7 +332,8 @@ bool print_send_printtypeknown(wimp_message *m) m->action = message_PRINT_TYPE_KNOWN; e = xwimp_send_message(wimp_USER_MESSAGE, m, m->sender); if (e) { - LOG("xwimp_send_message: 0x%x: %s", e->errnum, e->errmess); + NSLOG(netsurf, INFO, "xwimp_send_message: 0x%x: %s", + e->errnum, e->errmess); ro_warn_user("WimpError", e->errmess); return false; } @@ -436,7 +439,8 @@ bool ro_print_ack(wimp_message *m) /* read printer driver type */ error = xpdriver_info(&info_type, 0, 0, 0, 0, 0, 0, 0); if (error) { - LOG("xpdriver_info: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xpdriver_info: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("PrintError", error->errmess); ro_print_cleanup(); return true; @@ -461,7 +465,8 @@ bool ro_print_ack(wimp_message *m) error = xwimp_send_message(wimp_USER_MESSAGE_RECORDED, m, m->sender); if (error) { - LOG("xwimp_send_message: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_send_message: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); /* and delete temporary file */ xosfile_delete(m->data.data_xfer.file_name, @@ -533,7 +538,8 @@ bool print_document(struct gui_window *g, const char *filename) /* read printer driver features */ error = xpdriver_info(0, 0, 0, &features, 0, 0, 0, 0); if (error) { - LOG("xpdriver_info: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xpdriver_info: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("PrintError", error->errmess); return false; } @@ -541,7 +547,8 @@ bool print_document(struct gui_window *g, const char *filename) /* read page size */ error = xpdriver_page_size(0, 0, &left, &bottom, &right, &top); if (error) { - LOG("xpdriver_page_size: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xpdriver_page_size: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("PrintError", error->errmess); return false; } @@ -564,7 +571,8 @@ bool print_document(struct gui_window *g, const char *filename) error = xosfind_openoutw(osfind_NO_PATH | osfind_ERROR_IF_DIR | osfind_ERROR_IF_ABSENT, filename, 0, &fhandle); if (error) { - LOG("xosfind_openoutw: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xosfind_openoutw: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("PrintError", error->errmess); return false; } @@ -572,7 +580,8 @@ bool print_document(struct gui_window *g, const char *filename) /* select print job */ error = xpdriver_select_jobw(fhandle, "NetSurf", &old_job); if (error) { - LOG("xpdriver_select_jobw: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xpdriver_select_jobw: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("PrintError", error->errmess); xosfind_closew(fhandle); return false; @@ -632,18 +641,23 @@ bool print_document(struct gui_window *g, const char *filename) /* give page rectangle */ error = xpdriver_give_rectangle(0, &b, &t, &p, os_COLOUR_WHITE); if (error) { - LOG("xpdriver_give_rectangle: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, + "xpdriver_give_rectangle: 0x%x: %s", + error->errnum, + error->errmess); error_message = error->errmess; goto error; } - LOG("given rectangle: [(%d, %d), (%d, %d)]", b.x0, b.y0, b.x1, b.y1); + NSLOG(netsurf, INFO, "given rectangle: [(%d, %d), (%d, %d)]", + b.x0, b.y0, b.x1, b.y1); /* and redraw the document */ error = xpdriver_draw_page(print_num_copies, &b, 0, 0, &more, 0); if (error) { - LOG("xpdriver_draw_page: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xpdriver_draw_page: 0x%x: %s", + error->errnum, error->errmess); error_message = error->errmess; goto error; } @@ -657,7 +671,9 @@ bool print_document(struct gui_window *g, const char *filename) .plot = &ro_plotters }; - LOG("redrawing area: [(%d, %d), (%d, %d)]", b.x0, b.y0, b.x1, b.y1); + NSLOG(netsurf, INFO, + "redrawing area: [(%d, %d), (%d, %d)]", b.x0, + b.y0, b.x1, b.y1); clip.x0 = (b.x0 - ro_plot_origin_x) / 2; clip.y0 = (ro_plot_origin_y - b.y1) / 2; clip.x1 = (b.x1 - ro_plot_origin_x) / 2; @@ -679,7 +695,10 @@ bool print_document(struct gui_window *g, const char *filename) error = xpdriver_get_rectangle(&b, &more, 0); if (error) { - LOG("xpdriver_get_rectangle: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, + "xpdriver_get_rectangle: 0x%x: %s", + error->errnum, + error->errmess); error_message = error->errmess; goto error; } @@ -701,14 +720,16 @@ bool print_document(struct gui_window *g, const char *filename) error = (os_error *) _swix(PDriver_EndJob, _IN(0), (int) fhandle); if (error) { - LOG("xpdriver_end_jobw: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xpdriver_end_jobw: 0x%x: %s", + error->errnum, error->errmess); error_message = error->errmess; goto error; } error = xosfind_closew(fhandle); if (error) { - LOG("xosfind_closew: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xosfind_closew: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("PrintError", error->errmess); return false; } @@ -716,7 +737,10 @@ bool print_document(struct gui_window *g, const char *filename) if (old_job) { error = xpdriver_select_jobw(old_job, 0, 0); if (error) { - LOG("xpdriver_select_jobw: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, + "xpdriver_select_jobw: 0x%x: %s", + error->errnum, + error->errmess); ro_warn_user("PrintError", error->errmess); /* the printing succeeded anyway */ return true; @@ -855,11 +879,14 @@ print_fonts_plot_text(const struct redraw_context *ctx, text, length, 0, 0, print_fonts_callback, 0); if (code != rufl_OK) { if (code == rufl_FONT_MANAGER_ERROR) { - LOG("rufl_paint_callback: rufl_FONT_MANAGER_ERROR: ""0x%x: %s", - rufl_fm_error->errnum, rufl_fm_error->errmess); + NSLOG(netsurf, INFO, + "rufl_paint_callback: rufl_FONT_MANAGER_ERROR: ""0x%x: %s", + rufl_fm_error->errnum, + rufl_fm_error->errmess); print_fonts_error = rufl_fm_error->errmess; } else { - LOG("rufl_paint_callback: 0x%x", code); + NSLOG(netsurf, INFO, "rufl_paint_callback: 0x%x", + code); } return NSERROR_INVALID; } @@ -934,18 +961,22 @@ const char *print_declare_fonts(struct hlcache_handle *h) } for (i = 0; i != print_fonts_count; ++i) { - LOG("%u %s", i, print_fonts_list[i]); + NSLOG(netsurf, INFO, "%u %s", i, print_fonts_list[i]); error = xpdriver_declare_font(0, print_fonts_list[i], pdriver_KERNED); if (error) { - LOG("xpdriver_declare_font: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, + "xpdriver_declare_font: 0x%x: %s", + error->errnum, + error->errmess); error_message = error->errmess; goto end; } } error = xpdriver_declare_font(0, 0, 0); if (error) { - LOG("xpdriver_declare_font: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xpdriver_declare_font: 0x%x: %s", + error->errnum, error->errmess); error_message = error->errmess; goto end; } diff --git a/frontends/riscos/query.c b/frontends/riscos/query.c index 1d7cf5120..49aea6321 100644 --- a/frontends/riscos/query.c +++ b/frontends/riscos/query.c @@ -175,7 +175,7 @@ query_id query_user_xy(const char *query, const char *detail, err = utf8_to_local_encoding(yes, 0, &local_text); if (err != NSERROR_OK) { assert(err != NSERROR_BAD_ENCODING); - LOG("utf8_to_local_encoding_failed"); + NSLOG(netsurf, INFO, "utf8_to_local_encoding_failed"); local_text = NULL; } @@ -191,7 +191,8 @@ query_id query_user_xy(const char *query, const char *detail, error = xwimptextop_string_width(icn->data.indirected_text.text, len, &width); if (error) { - LOG("xwimptextop_string_width: 0x%x:%s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimptextop_string_width: 0x%x:%s", + error->errnum, error->errmess); width = len * 16; } if (!query_yes_width) query_yes_width = icn->extent.x1 - icn->extent.x0; @@ -204,7 +205,7 @@ query_id query_user_xy(const char *query, const char *detail, err = utf8_to_local_encoding(no, 0, &local_text); if (err != NSERROR_OK) { assert(err != NSERROR_BAD_ENCODING); - LOG("utf8_to_local_encoding_failed"); + NSLOG(netsurf, INFO, "utf8_to_local_encoding_failed"); local_text = NULL; } @@ -222,7 +223,8 @@ query_id query_user_xy(const char *query, const char *detail, icn->extent.x1 = tx - 16; error = xwimptextop_string_width(icn->data.indirected_text.text, len, &width); if (error) { - LOG("xwimptextop_string_width: 0x%x:%s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimptextop_string_width: 0x%x:%s", + error->errnum, error->errmess); width = len * 16; } width += 28; @@ -263,7 +265,8 @@ query_id query_user_xy(const char *query, const char *detail, error = xwimp_set_caret_position(qw->window, (wimp_i)-1, 0, 0, 1 << 25, -1); if (error) { - LOG("xwimp_get_caret_position: 0x%x : %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_get_caret_position: 0x%x : %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); } @@ -307,7 +310,10 @@ void ro_gui_query_window_bring_to_front(query_id id) error = xwimp_set_caret_position(qw->window, (wimp_i)-1, 0, 0, 1 << 25, -1); if (error) { - LOG("xwimp_get_caret_position: 0x%x : %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, + "xwimp_get_caret_position: 0x%x : %s", + error->errnum, + error->errmess); ro_warn_user("WimpError", error->errmess); } } @@ -327,7 +333,8 @@ void ro_gui_query_close(wimp_w w) ro_gui_dialog_close(w); error = xwimp_delete_window(qw->window); if (error) { - LOG("xwimp_delete_window: 0x%x:%s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_delete_window: 0x%x:%s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); } ro_gui_wimp_event_finalise(w); diff --git a/frontends/riscos/save.c b/frontends/riscos/save.c index bed0f5dd1..76ce6d3e5 100644 --- a/frontends/riscos/save.c +++ b/frontends/riscos/save.c @@ -166,7 +166,8 @@ wimp_w ro_gui_saveas_create(const char *template_name) error = xosmodule_alloc(area_size, (void **) &area); if (error) { - LOG("xosmodule_alloc: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xosmodule_alloc: 0x%x: %s", + error->errnum, error->errmess); xwimp_close_template(); die(error->errmess); } else { @@ -176,7 +177,10 @@ wimp_w ro_gui_saveas_create(const char *template_name) error = xosspriteop_clear_sprites(osspriteop_USER_AREA, saveas_area); if (error) { - LOG("xosspriteop_clear_sprites: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, + "xosspriteop_clear_sprites: 0x%x: %s", + error->errnum, + error->errmess); ro_warn_user("MiscError", error->errmess); xosmodule_free(saveas_area); @@ -192,7 +196,8 @@ wimp_w ro_gui_saveas_create(const char *template_name) /* create window */ error = xwimp_create_window(window, &w); if (error) { - LOG("xwimp_create_window: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_create_window: 0x%x: %s", + error->errnum, error->errmess); xwimp_close_template(); die(error->errmess); } @@ -212,7 +217,8 @@ void ro_gui_saveas_quit(void) if (saveas_area) { os_error *error = xosmodule_free(saveas_area); if (error) { - LOG("xosmodule_free: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xosmodule_free: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("MiscError", error->errmess); } saveas_area = NULL; @@ -239,14 +245,14 @@ ro_gui_save_create_thumbnail(struct hlcache_handle *h, const char *name) bitmap = riscos_bitmap_create(34, 34, BITMAP_NEW | BITMAP_OPAQUE | BITMAP_CLEAR_MEMORY); if (!bitmap) { - LOG("Thumbnail initialisation failed."); + NSLOG(netsurf, INFO, "Thumbnail initialisation failed."); return false; } riscos_bitmap_render(bitmap, h); area = riscos_bitmap_convert_8bpp(bitmap); riscos_bitmap_destroy(bitmap); if (!area) { - LOG("Thumbnail conversion failed."); + NSLOG(netsurf, INFO, "Thumbnail conversion failed."); return false; } @@ -391,7 +397,10 @@ ro_gui_save_set_state(struct hlcache_handle *h, gui_save_type save_type, } if (error) { - LOG("ro_gui_wimp_get_sprite: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, + "ro_gui_wimp_get_sprite: 0x%x: %s", + error->errnum, + error->errmess); ro_warn_user("MiscError", error->errmess); } else { /* the sprite area should always be large enough for @@ -501,7 +510,8 @@ static void ro_gui_save_drag_end(wimp_dragged *drag, void *data) error = xwimp_get_pointer_info(&pointer); if (error) { - LOG("xwimp_get_pointer_info: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_get_pointer_info: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); return; } @@ -627,7 +637,8 @@ static void ro_gui_save_done(void) error = xwimp_send_message(wimp_USER_MESSAGE, message, message->sender); if (error) { - LOG("xwimp_send_message: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_send_message: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("SaveError", error->errmess); } } @@ -667,7 +678,10 @@ static void ro_gui_save_done(void) ro_gui_dialog_close(dialog_saveas); error = xwimp_create_menu(wimp_CLOSE_MENU, 0, 0); if (error) { - LOG("xwimp_create_menu: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, + "xwimp_create_menu: 0x%x: %s", + error->errnum, + error->errmess); ro_warn_user("MenuError", error->errmess); } } @@ -770,8 +784,8 @@ static void ro_gui_save_set_file_type(const char *path, lwc_string *mime_type) error = xosfile_set_type(path, rotype); if (error != NULL) { - LOG("xosfile_set_type: 0x%x: %s", - error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xosfile_set_type: 0x%x: %s", + error->errnum, error->errmess); } } @@ -798,7 +812,8 @@ static bool ro_gui_save_complete(struct hlcache_handle *h, char *path) /* Create dir */ error = xosfile_create_dir(path, 0); if (error) { - LOG("xosfile_create_dir: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xosfile_create_dir: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("SaveError", error->errmess); return false; } @@ -807,7 +822,7 @@ static bool ro_gui_save_complete(struct hlcache_handle *h, char *path) snprintf(buf, sizeof buf, "%s.!Run", path); fp = fopen(buf, "w"); if (!fp) { - LOG("fopen(): errno = %i", errno); + NSLOG(netsurf, INFO, "fopen(): errno = %i", errno); ro_warn_user("SaveError", strerror(errno)); return false; } @@ -816,7 +831,8 @@ static bool ro_gui_save_complete(struct hlcache_handle *h, char *path) fclose(fp); error = xosfile_set_type(buf, 0xfeb); if (error) { - LOG("xosfile_set_type: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xosfile_set_type: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("SaveError", error->errmess); return false; } @@ -825,7 +841,8 @@ static bool ro_gui_save_complete(struct hlcache_handle *h, char *path) snprintf(buf, sizeof buf, "%s.!RunImage", path); fp = fopen(buf, "w"); if (!fp) { - LOG("Creating !RunImage failed: errno = %i", errno); + NSLOG(netsurf, INFO, "Creating !RunImage failed: errno = %i", + errno); } else { fclose(fp); } @@ -851,7 +868,10 @@ static bool ro_gui_save_complete(struct hlcache_handle *h, char *path) error = xosspriteop_save_sprite_file(osspriteop_NAME, saveas_area, buf); if (error) { - LOG("xosspriteop_save_sprite_file: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, + "xosspriteop_save_sprite_file: 0x%x: %s", + error->errnum, + error->errmess); ro_warn_user("SaveError", error->errmess); return false; } @@ -897,7 +917,10 @@ static bool ro_gui_save_object_native(struct hlcache_handle *h, char *path) (byte *) source_data, (byte *) source_data + source_size); if (error != NULL) { - LOG("xosfile_save_stamped: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, + "xosfile_save_stamped: 0x%x: %s", + error->errnum, + error->errmess); ro_warn_user("SaveError", error->errmess); return false; } @@ -947,7 +970,8 @@ ro_gui_save_content(struct hlcache_handle *h, char *path, bool force_overwrite) error = xosfile_read_stamped(path, &obj_type, NULL, NULL, NULL, NULL, NULL); if (error) { - LOG("xosfile_read_stamped: 0x%x:%s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xosfile_read_stamped: 0x%x:%s", + error->errnum, error->errmess); ro_warn_user("SaveError", error->errmess); return false; } @@ -1003,7 +1027,10 @@ ro_gui_save_content(struct hlcache_handle *h, char *path, bool force_overwrite) (byte *) source_data, (byte *) source_data + source_size); if (error) { - LOG("xosfile_save_stamped: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, + "xosfile_save_stamped: 0x%x: %s", + error->errnum, + error->errmess); ro_warn_user("SaveError", error->errmess); return false; } @@ -1029,14 +1056,20 @@ ro_gui_save_content(struct hlcache_handle *h, char *path, bool force_overwrite) return false; error = xosfile_set_type(path, 0xfaf); if (error) - LOG("xosfile_set_type: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, + "xosfile_set_type: 0x%x: %s", + error->errnum, + error->errmess); break; case GUI_SAVE_HISTORY_EXPORT_HTML: if (global_history_export(path, NULL) != NSERROR_OK) return false; error = xosfile_set_type(path, 0xfaf); if (error) - LOG("xosfile_set_type: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, + "xosfile_set_type: 0x%x: %s", + error->errnum, + error->errmess); break; case GUI_SAVE_TEXT_SELECTION: @@ -1056,7 +1089,10 @@ ro_gui_save_content(struct hlcache_handle *h, char *path, bool force_overwrite) return ro_gui_save_clipboard(path); default: - LOG("Unexpected content type: %d, path %s", gui_save_current_type, path); + NSLOG(netsurf, INFO, + "Unexpected content type: %d, path %s", + gui_save_current_type, + path); return false; } return true; @@ -1121,7 +1157,8 @@ void gui_drag_save_object(struct gui_window *g, error = xwimp_get_pointer_info(&pointer); if (error) { - LOG("xwimp_get_pointer_info: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_get_pointer_info: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); return; } @@ -1158,7 +1195,8 @@ void gui_drag_save_selection(struct gui_window *g, const char *selection) error = xwimp_get_pointer_info(&pointer); if (error) { - LOG("xwimp_get_pointer_info: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_get_pointer_info: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); return; } @@ -1210,8 +1248,8 @@ void ro_gui_drag_save_link(gui_save_type save_type, const nsurl *url, error = xwimp_get_pointer_info(&pointer); if (error) { - LOG("xwimp_get_pointer_info: 0x%x: %s", - error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_get_pointer_info: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); return; } @@ -1252,7 +1290,10 @@ void ro_gui_drag_icon(int x, int y, const char *sprite) saveas_area, (osspriteop_id)sprite, NULL); if (error) { if (error->errnum != error_SPRITE_OP_DOESNT_EXIST) { - LOG("xosspriteop_select_sprite: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, + "xosspriteop_select_sprite: 0x%x: %s", + error->errnum, + error->errmess); ro_warn_user("MiscError", error->errmess); } } @@ -1272,7 +1313,8 @@ void ro_gui_drag_icon(int x, int y, const char *sprite) return; } - LOG("xdragasprite_start: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xdragasprite_start: 0x%x: %s", + error->errnum, error->errmess); } drag.type = wimp_DRAG_USER_FIXED; @@ -1285,7 +1327,8 @@ void ro_gui_drag_icon(int x, int y, const char *sprite) error = xwimp_drag_box(&drag); if (error) { - LOG("xwimp_drag_box: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_drag_box: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("DragError", error->errmess); } else { dragbox_active = true; @@ -1323,14 +1366,20 @@ void ro_gui_drag_box_cancel(void) if (using_dragasprite) { error = xdragasprite_stop(); if (error) { - LOG("xdragasprite_stop: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, + "xdragasprite_stop: 0x%x: %s", + error->errnum, + error->errmess); ro_warn_user("WimpError", error->errmess); } } else { error = xwimp_drag_box(NULL); if (error) { - LOG("xwimp_drag_box: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, + "xwimp_drag_box: 0x%x: %s", + error->errnum, + error->errmess); ro_warn_user("WimpError", error->errmess); } } @@ -1384,7 +1433,8 @@ void ro_gui_save_datasave_ack(wimp_message *message) default: if (!gui_save_content) { - LOG("unexpected DataSaveAck: gui_save_content not set"); + NSLOG(netsurf, INFO, + "unexpected DataSaveAck: gui_save_content not set"); return; } break; diff --git a/frontends/riscos/save_draw.c b/frontends/riscos/save_draw.c index 1e0bc1ec6..9ee730434 100644 --- a/frontends/riscos/save_draw.c +++ b/frontends/riscos/save_draw.c @@ -54,7 +54,7 @@ static int ro_save_draw_height; */ static nserror ro_save_draw_error(pencil_code code) { - LOG("code %i", code); + NSLOG(netsurf, INFO, "code %i", code); switch (code) { case pencil_OK: @@ -333,13 +333,13 @@ ro_save_draw_path(const struct redraw_context *ctx, return NSERROR_OK; if (p[0] != PLOTTER_PATH_MOVE) { - LOG("path doesn't start with a move"); + NSLOG(netsurf, INFO, "path doesn't start with a move"); return NSERROR_INVALID; } path = malloc(sizeof *path * (n + 10)); if (!path) { - LOG("out of memory"); + NSLOG(netsurf, INFO, "out of memory"); return NSERROR_INVALID; } @@ -389,7 +389,7 @@ ro_save_draw_path(const struct redraw_context *ctx, i += 7; empty_path = false; } else { - LOG("bad path command %f", p[i]); + NSLOG(netsurf, INFO, "bad path command %f", p[i]); free(path); return NSERROR_INVALID; } @@ -624,8 +624,8 @@ bool save_as_draw(struct hlcache_handle *h, const char *path) (byte *) drawfile_buffer, (byte *) drawfile_buffer + drawfile_size); if (error) { - LOG("xosfile_save_stamped failed: 0x%x: %s", - error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xosfile_save_stamped failed: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("SaveError", error->errmess); pencil_free(ro_save_draw_diagram); return false; diff --git a/frontends/riscos/schedule.c b/frontends/riscos/schedule.c index 54308b7a9..cb44d906d 100644 --- a/frontends/riscos/schedule.c +++ b/frontends/riscos/schedule.c @@ -108,7 +108,7 @@ nserror riscos_schedule(int t, void (*callback)(void *p), void *p) entry = malloc(sizeof *entry); if (!entry) { - LOG("malloc failed"); + NSLOG(netsurf, INFO, "malloc failed"); return NSERROR_NOMEM; } diff --git a/frontends/riscos/sslcert.c b/frontends/riscos/sslcert.c index 85b84456e..4d81268f4 100644 --- a/frontends/riscos/sslcert.c +++ b/frontends/riscos/sslcert.c @@ -82,14 +82,14 @@ static void ro_gui_cert_release_window(struct ro_cert_window *certw) error = xwimp_delete_window(certw->wh); if (error) { - LOG("xwimp_delete_window: 0x%x:%s", - error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_delete_window: 0x%x:%s", + error->errnum, error->errmess); } error = xwimp_delete_window(certw->core.wh); if (error) { - LOG("xwimp_delete_window: 0x%x:%s", - error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_delete_window: 0x%x:%s", + error->errnum, error->errmess); } free(certw); @@ -165,16 +165,16 @@ static nserror cert_attach_pane(wimp_w parent, wimp_w pane) winfo.w = pane; error = xwimp_get_window_info_header_only(&winfo); if (error) { - LOG("xwimp_get_window_info: 0x%x: %s", - error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_get_window_info: 0x%x: %s", + error->errnum, error->errmess); return NSERROR_INIT_FAILED; } wstate.w = parent; error = xwimp_get_window_state(&wstate); if (error) { - LOG("xwimp_get_window_state: 0x%x: %s", - error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_get_window_state: 0x%x: %s", + error->errnum, error->errmess); return NSERROR_INIT_FAILED; } @@ -182,8 +182,8 @@ static nserror cert_attach_pane(wimp_w parent, wimp_w pane) istate.i = ICON_SSL_PANE; error = xwimp_get_icon_state(&istate); if (error) { - LOG("xwimp_get_icon_state: 0x%x: %s", - error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_get_icon_state: 0x%x: %s", + error->errnum, error->errmess); return NSERROR_INIT_FAILED; } @@ -211,8 +211,8 @@ static nserror cert_attach_pane(wimp_w parent, wimp_w pane) if (set_extent) { error = xwimp_set_extent(pane, &(winfo.extent)); if (error) { - LOG("xwimp_set_extent: 0x%x: %s", - error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_set_extent: 0x%x: %s", + error->errnum, error->errmess); return NSERROR_INIT_FAILED; } } @@ -225,8 +225,8 @@ static nserror cert_attach_pane(wimp_w parent, wimp_w pane) wimp_CHILD_LINKS_PARENT_VISIBLE_BOTTOM_OR_LEFT << wimp_CHILD_LS_EDGE_SHIFT | wimp_CHILD_LINKS_PARENT_VISIBLE_BOTTOM_OR_LEFT << wimp_CHILD_RS_EDGE_SHIFT); if (error) { - LOG("xwimp_open_window_nested: 0x%x: %s", - error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_open_window_nested: 0x%x: %s", + error->errnum, error->errmess); return NSERROR_INIT_FAILED; } @@ -336,8 +336,8 @@ gui_cert_verify(nsurl *url, /* Create the SSL window */ error = xwimp_create_window(dialog_cert_template, &ncwin->wh); if (error) { - LOG("xwimp_create_window: 0x%x: %s", - error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_create_window: 0x%x: %s", + error->errnum, error->errmess); free(ncwin); return NSERROR_INIT_FAILED; } @@ -345,8 +345,8 @@ gui_cert_verify(nsurl *url, /* create ssl viewer pane window */ error = xwimp_create_window(cert_tree_template, &ncwin->core.wh); if (error) { - LOG("xwimp_create_window: 0x%x: %s", - error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_create_window: 0x%x: %s", + error->errnum, error->errmess); free(ncwin); return NSERROR_INIT_FAILED; } diff --git a/frontends/riscos/textarea.c b/frontends/riscos/textarea.c index d9872927c..6f41c640b 100644 --- a/frontends/riscos/textarea.c +++ b/frontends/riscos/textarea.c @@ -138,7 +138,7 @@ uintptr_t ro_textarea_create(wimp_w parent, wimp_i icon, unsigned int flags, ret = malloc(sizeof(struct text_area)); if (!ret) { - LOG("malloc failed"); + NSLOG(netsurf, INFO, "malloc failed"); return 0; } @@ -148,7 +148,7 @@ uintptr_t ro_textarea_create(wimp_w parent, wimp_i icon, unsigned int flags, ret->flags = flags; ret->text = malloc(64); if (!ret->text) { - LOG("malloc failed"); + NSLOG(netsurf, INFO, "malloc failed"); free(ret); return 0; } @@ -160,7 +160,7 @@ uintptr_t ro_textarea_create(wimp_w parent, wimp_i icon, unsigned int flags, // ret->selection_end = (unsigned int)-1; ret->font_family = strdup(font_family ? font_family : "Corpus"); if (!ret->font_family) { - LOG("strdup failed"); + NSLOG(netsurf, INFO, "strdup failed"); free(ret->text); free(ret); return 0; @@ -181,7 +181,8 @@ uintptr_t ro_textarea_create(wimp_w parent, wimp_i icon, unsigned int flags, text_area_definition.title_fg = wimp_COLOUR_BLACK; error = xwimp_create_window(&text_area_definition, &ret->window); if (error) { - LOG("xwimp_create_window: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_create_window: 0x%x: %s", + error->errnum, error->errmess); free(ret->font_family); free(ret->text); free(ret); @@ -228,7 +229,8 @@ bool ro_textarea_update(uintptr_t self) state.w = ta->parent; error = xwimp_get_window_state(&state); if (error) { - LOG("xwimp_get_window_state: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_get_window_state: 0x%x: %s", + error->errnum, error->errmess); return false; } @@ -236,7 +238,8 @@ bool ro_textarea_update(uintptr_t self) istate.i = ta->icon; error = xwimp_get_icon_state(&istate); if (error) { - LOG("xwimp_get_icon_state: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_get_icon_state: 0x%x: %s", + error->errnum, error->errmess); return false; } @@ -267,7 +270,8 @@ bool ro_textarea_update(uintptr_t self) error = xwimp_set_extent(ta->window, &extent); if (error) { - LOG("xwimp_set_extent: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_set_extent: 0x%x: %s", + error->errnum, error->errmess); return false; } @@ -282,7 +286,8 @@ bool ro_textarea_update(uintptr_t self) wimp_CHILD_LINKS_PARENT_VISIBLE_BOTTOM_OR_LEFT << wimp_CHILD_RS_EDGE_SHIFT); if (error) { - LOG("xwimp_open_window_nested: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_open_window_nested: 0x%x: %s", + error->errnum, error->errmess); return false; } @@ -307,7 +312,8 @@ void ro_textarea_destroy(uintptr_t self) error = xwimp_delete_window(ta->window); if (error) { - LOG("xwimp_delete_window: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_delete_window: 0x%x: %s", + error->errnum, error->errmess); } ro_gui_wimp_event_finalise(ta->window); @@ -331,14 +337,14 @@ bool ro_textarea_set_text(uintptr_t self, const char *text) ta = (struct text_area *)self; if (!ta || ta->magic != MAGIC) { - LOG("magic doesn't match"); + NSLOG(netsurf, INFO, "magic doesn't match"); return true; } if (len >= ta->text_alloc) { char *temp = realloc(ta->text, len + 64); if (!temp) { - LOG("realloc failed"); + NSLOG(netsurf, INFO, "realloc failed"); return false; } ta->text = temp; @@ -368,7 +374,7 @@ int ro_textarea_get_text(uintptr_t self, char *buf, unsigned int len) ta = (struct text_area *)self; if (!ta || ta->magic != MAGIC) { - LOG("magic doesn't match"); + NSLOG(netsurf, INFO, "magic doesn't match"); return -1; } @@ -378,7 +384,7 @@ int ro_textarea_get_text(uintptr_t self, char *buf, unsigned int len) } if (len < ta->text_len) { - LOG("buffer too small"); + NSLOG(netsurf, INFO, "buffer too small"); return -1; } @@ -403,7 +409,7 @@ void ro_textarea_insert_text(uintptr_t self, unsigned int index, ta = (struct text_area *)self; if (!ta || ta->magic != MAGIC) { - LOG("magic doesn't match"); + NSLOG(netsurf, INFO, "magic doesn't match"); return; } @@ -420,7 +426,7 @@ void ro_textarea_insert_text(uintptr_t self, unsigned int index, if (b_len + ta->text_len >= ta->text_alloc) { char *temp = realloc(ta->text, b_len + ta->text_len + 64); if (!temp) { - LOG("realloc failed"); + NSLOG(netsurf, INFO, "realloc failed"); return; } @@ -457,7 +463,7 @@ void ro_textarea_replace_text(uintptr_t self, unsigned int start, ta = (struct text_area *)self; if (!ta || ta->magic != MAGIC) { - LOG("magic doesn't match"); + NSLOG(netsurf, INFO, "magic doesn't match"); return; } @@ -491,7 +497,7 @@ void ro_textarea_replace_text(uintptr_t self, unsigned int start, char *temp = realloc(ta->text, b_len + ta->text_len - (b_end - b_start) + 64); if (!temp) { - LOG("realloc failed"); + NSLOG(netsurf, INFO, "realloc failed"); return; } @@ -532,7 +538,7 @@ void ro_textarea_set_caret(uintptr_t self, unsigned int caret) ta = (struct text_area *)self; if (!ta || ta->magic != MAGIC) { - LOG("magic doesn't match"); + NSLOG(netsurf, INFO, "magic doesn't match"); return; } @@ -574,9 +580,10 @@ void ro_textarea_set_caret(uintptr_t self, unsigned int caret) b_off - ta->lines[ta->caret_pos.line].b_start, &x); if (code != rufl_OK) { if (code == rufl_FONT_MANAGER_ERROR) - LOG("rufl_width: 0x%x: %s", rufl_fm_error->errnum, rufl_fm_error->errmess); + NSLOG(netsurf, INFO, "rufl_width: 0x%x: %s", + rufl_fm_error->errnum, rufl_fm_error->errmess); else - LOG("rufl_width: 0x%x", code); + NSLOG(netsurf, INFO, "rufl_width: 0x%x", code); return; } @@ -585,7 +592,8 @@ void ro_textarea_set_caret(uintptr_t self, unsigned int caret) ta->line_height / 4 + ta->line_spacing, os_line_height.y, -1); if (error) { - LOG("xwimp_set_caret_position: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_set_caret_position: 0x%x: %s", + error->errnum, error->errmess); return; } } @@ -609,7 +617,7 @@ void ro_textarea_set_caret_xy(uintptr_t self, int x, int y) ta = (struct text_area *)self; if (!ta || ta->magic != MAGIC) { - LOG("magic doesn't match"); + NSLOG(netsurf, INFO, "magic doesn't match"); return; } @@ -623,7 +631,8 @@ void ro_textarea_set_caret_xy(uintptr_t self, int x, int y) state.w = ta->window; error = xwimp_get_window_state(&state); if (error) { - LOG("xwimp_get_window_state: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_get_window_state: 0x%x: %s", + error->errnum, error->errmess); return; } @@ -644,9 +653,10 @@ void ro_textarea_set_caret_xy(uintptr_t self, int x, int y) x, &b_off, &x); if (code != rufl_OK) { if (code == rufl_FONT_MANAGER_ERROR) - LOG("rufl_x_to_offset: 0x%x: %s", rufl_fm_error->errnum, rufl_fm_error->errmess); + NSLOG(netsurf, INFO, "rufl_x_to_offset: 0x%x: %s", + rufl_fm_error->errnum, rufl_fm_error->errmess); else - LOG("rufl_x_to_offset: 0x%x", code); + NSLOG(netsurf, INFO, "rufl_x_to_offset: 0x%x", code); return; } @@ -670,7 +680,7 @@ unsigned int ro_textarea_get_caret(uintptr_t self) ta = (struct text_area *)self; if (!ta || ta->magic != MAGIC) { - LOG("magic doesn't match"); + NSLOG(netsurf, INFO, "magic doesn't match"); return -1; } @@ -711,7 +721,7 @@ void ro_textarea_reflow(struct text_area *ta, unsigned int line) ta->lines = malloc(LINE_CHUNK_SIZE * sizeof(struct line_info)); if (!ta->lines) { - LOG("malloc failed"); + NSLOG(netsurf, INFO, "malloc failed"); return; } } @@ -734,9 +744,13 @@ void ro_textarea_reflow(struct text_area *ta, unsigned int line) &b_off, &x); if (code != rufl_OK) { if (code == rufl_FONT_MANAGER_ERROR) - LOG("rufl_x_to_offset: 0x%x: %s", rufl_fm_error->errnum, rufl_fm_error->errmess); + NSLOG(netsurf, INFO, + "rufl_x_to_offset: 0x%x: %s", + rufl_fm_error->errnum, + rufl_fm_error->errmess); else - LOG("rufl_x_to_offset: 0x%x", code); + NSLOG(netsurf, INFO, + "rufl_x_to_offset: 0x%x", code); return; } @@ -745,7 +759,7 @@ void ro_textarea_reflow(struct text_area *ta, unsigned int line) (line_count + LINE_CHUNK_SIZE) * sizeof(struct line_info)); if (!temp) { - LOG("realloc failed"); + NSLOG(netsurf, INFO, "realloc failed"); return; } @@ -809,7 +823,8 @@ void ro_textarea_reflow(struct text_area *ta, unsigned int line) error = xwimp_set_extent(ta->window, &extent); if (error) { - LOG("xwimp_set_extent: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_set_extent: 0x%x: %s", + error->errnum, error->errmess); return; } @@ -826,7 +841,10 @@ void ro_textarea_reflow(struct text_area *ta, unsigned int line) error = xwimp_get_window_state_and_nesting(&state, &parent, &linkage); if (error) { - LOG("xwimp_get_window_state_and_nesting: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, + "xwimp_get_window_state_and_nesting: 0x%x: %s", + error->errnum, + error->errmess); return; } @@ -839,7 +857,10 @@ void ro_textarea_reflow(struct text_area *ta, unsigned int line) state.w = ta->window; error = xwimp_get_window_state(&state); if (error) { - LOG("xwimp_get_window_state: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, + "xwimp_get_window_state: 0x%x: %s", + error->errnum, + error->errmess); return; } @@ -853,7 +874,10 @@ void ro_textarea_reflow(struct text_area *ta, unsigned int line) error = xwimp_open_window_nested(PTR_WIMP_OPEN(&state), parent, linkage); if (error) { - LOG("xwimp_open_window_nested: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, + "xwimp_open_window_nested: 0x%x: %s", + error->errnum, + error->errmess); return; } @@ -1009,7 +1033,10 @@ bool ro_textarea_key_press(wimp_key *key) (wimp_message*)&keypress, ta->parent, ta->icon, 0); if (error) { - LOG("xwimp_send_message: 0x%x:%s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, + "xwimp_send_message: 0x%x:%s", + error->errnum, + error->errmess); } break; } @@ -1060,7 +1087,8 @@ void ro_textarea_redraw_internal(wimp_draw *redraw, bool update) else error = xwimp_redraw_window(redraw, &more); if (error) { - LOG("xwimp_redraw_window: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_redraw_window: 0x%x: %s", + error->errnum, error->errmess); return; } @@ -1076,13 +1104,17 @@ void ro_textarea_redraw_internal(wimp_draw *redraw, bool update) colourtrans_SET_BG_GCOL | colourtrans_USE_ECFS_GCOL, os_ACTION_OVERWRITE, 0, 0); if (error) { - LOG("xcolourtrans_set_gcol: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, + "xcolourtrans_set_gcol: 0x%x: %s", + error->errnum, + error->errmess); return; } error = xos_clg(); if (error) { - LOG("xos_clg: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xos_clg: 0x%x: %s", + error->errnum, error->errmess); return; } @@ -1113,7 +1145,10 @@ void ro_textarea_redraw_internal(wimp_draw *redraw, bool update) 0xD9D9D900 : 0xFFFFFF00, 0x00000000, 14, 0, 0, 0); if (error) { - LOG("xcolourtrans_set_font_colours: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, + "xcolourtrans_set_font_colours: 0x%x: %s", + error->errnum, + error->errmess); return; } @@ -1128,15 +1163,20 @@ void ro_textarea_redraw_internal(wimp_draw *redraw, bool update) rufl_BLEND_FONT); if (code != rufl_OK) { if (code == rufl_FONT_MANAGER_ERROR) - LOG("rufl_paint: rufl_FONT_MANAGER_ERROR: 0x%x: %s", rufl_fm_error->errnum, rufl_fm_error->errmess); + NSLOG(netsurf, INFO, + "rufl_paint: rufl_FONT_MANAGER_ERROR: 0x%x: %s", + rufl_fm_error->errnum, + rufl_fm_error->errmess); else - LOG("rufl_paint: 0x%x", code); + NSLOG(netsurf, INFO, + "rufl_paint: 0x%x", code); } } error = xwimp_get_rectangle(redraw, &more); if (error) { - LOG("xwimp_get_rectangle: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_get_rectangle: 0x%x: %s", + error->errnum, error->errmess); return; } } @@ -1153,7 +1193,8 @@ void ro_textarea_open(wimp_open *open) error = xwimp_open_window(open); if (error) { - LOG("xwimp_open_window: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_open_window: 0x%x: %s", + error->errnum, error->errmess); return; } } diff --git a/frontends/riscos/textselection.c b/frontends/riscos/textselection.c index 5a430c06f..efec96b56 100644 --- a/frontends/riscos/textselection.c +++ b/frontends/riscos/textselection.c @@ -92,12 +92,13 @@ void gui_start_selection(struct gui_window *g) wimp_drag drag; os_error *error; - LOG("starting text_selection drag"); + NSLOG(netsurf, INFO, "starting text_selection drag"); state.w = g->window; error = xwimp_get_window_state(&state); if (error) { - LOG("xwimp_get_window_state 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_get_window_state 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); return; } @@ -111,7 +112,8 @@ void gui_start_selection(struct gui_window *g) error = xwimp_send_message(wimp_USER_MESSAGE, (wimp_message*)&msg, wimp_BROADCAST); if (error) { - LOG("xwimp_send_message: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_send_message: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); } owns_caret_and_selection = true; @@ -127,7 +129,8 @@ void gui_start_selection(struct gui_window *g) wimp_AUTO_SCROLL_ENABLE_HORIZONTAL, &scroll, 0); if (error) - LOG("xwimp_auto_scroll: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_auto_scroll: 0x%x: %s", + error->errnum, error->errmess); ro_mouse_drag_start(ro_gui_selection_drag_end, ro_gui_window_mouse_at, NULL, g); @@ -141,7 +144,8 @@ void gui_start_selection(struct gui_window *g) error = xwimp_drag_box(&drag); if (error) { - LOG("xwimp_drag_box: 0x%x : %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_drag_box: 0x%x : %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); } last_start_window = g; @@ -166,17 +170,20 @@ static void ro_gui_selection_drag_end(wimp_dragged *drag, void *data) scroll.w = g->window; error = xwimp_auto_scroll(0, &scroll, 0); if (error) - LOG("xwimp_auto_scroll: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_auto_scroll: 0x%x: %s", + error->errnum, error->errmess); error = xwimp_drag_box((wimp_drag*)-1); if (error) { - LOG("xwimp_drag_box: 0x%x : %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_drag_box: 0x%x : %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); } error = xwimp_get_pointer_info(&pointer); if (error) { - LOG("xwimp_get_pointer_info 0x%x : %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_get_pointer_info 0x%x : %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); return; } @@ -217,7 +224,7 @@ static void gui_set_clipboard(const char *buffer, size_t length, wimp_full_message_claim_entity msg; os_error *error; - LOG("claiming clipboard"); + NSLOG(netsurf, INFO, "claiming clipboard"); msg.size = sizeof(msg); msg.your_ref = 0; @@ -227,13 +234,14 @@ static void gui_set_clipboard(const char *buffer, size_t length, error = xwimp_send_message(wimp_USER_MESSAGE, (wimp_message*)&msg, wimp_BROADCAST); if (error) { - LOG("xwimp_send_message: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_send_message: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); } owns_clipboard = true; } - LOG("clipboard now holds %zd bytes", clip_length); + NSLOG(netsurf, INFO, "clipboard now holds %zd bytes", clip_length); } @@ -441,7 +449,7 @@ void ro_gui_selection_claim_entity(wimp_full_message_claim_entity *claim) /* ignore our own broadcasts! */ if (claim->sender != task_handle) { - LOG("%x", claim->flags); + NSLOG(netsurf, INFO, "%x", claim->flags); if (claim->flags & wimp_CLAIM_CARET_OR_SELECTION) { owns_caret_and_selection = false; @@ -524,7 +532,8 @@ bool ro_gui_save_clipboard(const char *path) free(local_cb); if (error) { - LOG("xosfile_save_stamped: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xosfile_save_stamped: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("SaveError", error->errmess); return false; } @@ -606,7 +615,8 @@ void ro_gui_selection_send_dragging(wimp_pointer *pointer) { wimp_full_message_dragging dragmsg; - LOG("sending DRAGGING to %p, %d", pointer->w, pointer->i); + NSLOG(netsurf, INFO, "sending DRAGGING to %p, %d", pointer->w, + pointer->i); dragmsg.size = offsetof(wimp_full_message_dragging, file_types) + 8; dragmsg.your_ref = 0; diff --git a/frontends/riscos/theme.c b/frontends/riscos/theme.c index b0b4ab879..661beb765 100644 --- a/frontends/riscos/theme.c +++ b/frontends/riscos/theme.c @@ -364,7 +364,7 @@ bool ro_gui_theme_add_descriptor(const char *folder, const char *leafname) /* create a full filename */ filename = malloc(strlen(folder) + strlen(leafname) + 2); if (!filename) { - LOG("No memory for malloc"); + NSLOG(netsurf, INFO, "No memory for malloc"); ro_warn_user("NoMemory", 0); return false; } @@ -374,7 +374,8 @@ bool ro_gui_theme_add_descriptor(const char *folder, const char *leafname) error = xosfind_openinw(osfind_NO_PATH, filename, 0, &file_handle); if (error) { - LOG("xosfind_openinw: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xosfind_openinw: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("FileError", error->errmess); free(filename); return false; @@ -389,7 +390,8 @@ bool ro_gui_theme_add_descriptor(const char *folder, const char *leafname) 0, &output_left); xosfind_closew(file_handle); if (error) { - LOG("xosbgpb_read_atw: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xosbgpb_read_atw: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("FileError", error->errmess); free(filename); return false; @@ -403,7 +405,7 @@ bool ro_gui_theme_add_descriptor(const char *folder, const char *leafname) current = (struct theme_descriptor *)calloc(1, sizeof(struct theme_descriptor)); if (!current) { - LOG("calloc failed"); + NSLOG(netsurf, INFO, "calloc failed"); ro_warn_user("NoMemory", 0); free(filename); return false; @@ -521,7 +523,7 @@ bool ro_gui_theme_open(struct theme_descriptor *descriptor, bool list) descriptor->theme = (struct theme *)calloc(1, sizeof(struct theme)); if (!descriptor->theme) { - LOG("calloc() failed"); + NSLOG(netsurf, INFO, "calloc() failed"); ro_warn_user("NoMemory", 0); continue; } @@ -531,7 +533,10 @@ bool ro_gui_theme_open(struct theme_descriptor *descriptor, bool list) error = xosfile_read_stamped_no_path(descriptor->filename, &obj_type, 0, 0, &file_size, 0, 0); if (error) { - LOG("xosfile_read_stamped_no_path: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, + "xosfile_read_stamped_no_path: 0x%x: %s", + error->errnum, + error->errmess); ro_warn_user("FileError", error->errmess); continue; } @@ -539,7 +544,7 @@ bool ro_gui_theme_open(struct theme_descriptor *descriptor, bool list) continue; raw_data = malloc(file_size); if (!raw_data) { - LOG("malloc() failed"); + NSLOG(netsurf, INFO, "malloc() failed"); ro_warn_user("NoMemory", 0); continue; } @@ -547,7 +552,10 @@ bool ro_gui_theme_open(struct theme_descriptor *descriptor, bool list) (byte *)raw_data, 0, 0, 0, 0, 0); if (error) { free(raw_data); - LOG("xosfile_load_stamped_no_path: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, + "xosfile_load_stamped_no_path: 0x%x: %s", + error->errnum, + error->errmess); ro_warn_user("FileError", error->errmess); continue; } @@ -556,7 +564,10 @@ bool ro_gui_theme_open(struct theme_descriptor *descriptor, bool list) error = xsquash_decompress_return_sizes(-1, &workspace_size, 0); if (error) { free(raw_data); - LOG("xsquash_decompress_return_sizes: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, + "xsquash_decompress_return_sizes: 0x%x: %s", + error->errnum, + error->errmess); ro_warn_user("MiscError", error->errmess); continue; } @@ -566,7 +577,7 @@ bool ro_gui_theme_open(struct theme_descriptor *descriptor, bool list) if ((!decompressed) || (!workspace)) { free(decompressed); free(raw_data); - LOG("malloc() failed"); + NSLOG(netsurf, INFO, "malloc() failed"); ro_warn_user("NoMemory", 0); continue; } @@ -581,7 +592,8 @@ bool ro_gui_theme_open(struct theme_descriptor *descriptor, bool list) free(raw_data); if (error) { free(decompressed); - LOG("xsquash_decompress: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xsquash_decompress: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("MiscError", error->errmess); continue; } @@ -599,7 +611,10 @@ bool ro_gui_theme_open(struct theme_descriptor *descriptor, bool list) descriptor->theme->sprite_area, sprite_name, 16, i, 0); if (error) { - LOG("xosspriteop_return_name: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, + "xosspriteop_return_name: 0x%x: %s", + error->errnum, + error->errmess); ro_warn_user("MiscError", error->errmess); continue; } @@ -614,7 +629,10 @@ bool ro_gui_theme_open(struct theme_descriptor *descriptor, bool list) &dimensions.x, &dimensions.y, (osbool *) 0, &mode); if (error) { - LOG("xosspriteop_read_sprite_info: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, + "xosspriteop_read_sprite_info: 0x%x: %s", + error->errnum, + error->errmess); ro_warn_user("MiscError", error->errmess); continue; } diff --git a/frontends/riscos/theme_install.c b/frontends/riscos/theme_install.c index 43ecb4687..fbca9e4fa 100644 --- a/frontends/riscos/theme_install.c +++ b/frontends/riscos/theme_install.c @@ -182,7 +182,7 @@ bool ro_gui_theme_install_apply(wimp_w w) /* convert spaces to hard spaces */ theme_file = strdup(theme_install_descriptor.name); if (!theme_file) { - LOG("malloc failed"); + NSLOG(netsurf, INFO, "malloc failed"); ro_warn_user("NoMemory", 0); return false; } @@ -203,7 +203,8 @@ bool ro_gui_theme_install_apply(wimp_w w) (byte *) source_data, (byte *) source_data + source_size); if (error) { - LOG("xosfile_save_stamped: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xosfile_save_stamped: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("ThemeInstallErr", 0); free(theme_file); return false; diff --git a/frontends/riscos/toolbar.c b/frontends/riscos/toolbar.c index 2b5cb3415..758c90cc2 100644 --- a/frontends/riscos/toolbar.c +++ b/frontends/riscos/toolbar.c @@ -227,7 +227,7 @@ struct toolbar *ro_toolbar_create(struct theme_descriptor *descriptor, toolbar = calloc(sizeof(struct toolbar), 1); if (toolbar == NULL) { - LOG("No memory for malloc()"); + NSLOG(netsurf, INFO, "No memory for malloc()"); ro_warn_user("NoMemory", 0); return NULL; } @@ -366,7 +366,8 @@ bool ro_toolbar_rebuild(struct toolbar *toolbar) old_window = toolbar->toolbar_handle; error = xwimp_delete_window(toolbar->toolbar_handle); if (error) - LOG("xwimp_delete_window: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_delete_window: 0x%x: %s", + error->errnum, error->errmess); toolbar->toolbar_handle = NULL; } @@ -375,7 +376,8 @@ bool ro_toolbar_rebuild(struct toolbar *toolbar) error = xwimp_create_window(&ro_toolbar_window, &toolbar->toolbar_handle); if (error) { - LOG("xwimp_create_window: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_create_window: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); return false; } @@ -493,7 +495,8 @@ bool ro_toolbar_rebuild(struct toolbar *toolbar) icon.icon.data.indirected_text.size = 1; error = xwimp_create_icon(&icon, &toolbar->editor_div1); if (error) { - LOG("xwimp_create_icon: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_create_icon: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); toolbar->editor_div1 = -1; } @@ -558,7 +561,10 @@ bool ro_toolbar_attach(struct toolbar *toolbar, wimp_w parent) wimp_CHILD_LINKS_PARENT_VISIBLE_TOP_OR_RIGHT << wimp_CHILD_TS_EDGE_SHIFT); if (error) { - LOG("xwimp_open_window_nested: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, + "xwimp_open_window_nested: 0x%x: %s", + error->errnum, + error->errmess); ro_warn_user("WimpError", error->errmess); return false; } @@ -568,7 +574,8 @@ bool ro_toolbar_attach(struct toolbar *toolbar, wimp_w parent) error = xwimp_close_window(toolbar->toolbar_handle); if (error) { - LOG("xwimp_close_window: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_close_window: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); return false; } @@ -601,7 +608,10 @@ bool ro_toolbar_process(struct toolbar *toolbar, int width, bool reformat) outline.w = toolbar->parent_handle; error = xwimp_get_window_outline(&outline); if (error) { - LOG("xwimp_get_window_outline: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, + "xwimp_get_window_outline: 0x%x: %s", + error->errnum, + error->errmess); ro_warn_user("WimpError", error->errmess); return false; } @@ -621,7 +631,10 @@ bool ro_toolbar_process(struct toolbar *toolbar, int width, bool reformat) state.w = toolbar->parent_handle; error = xwimp_get_window_state(&state); if (error) { - LOG("xwimp_get_window_state: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, + "xwimp_get_window_state: 0x%x: %s", + error->errnum, + error->errmess); ro_warn_user("WimpError", error->errmess); return false; } @@ -647,7 +660,10 @@ bool ro_toolbar_process(struct toolbar *toolbar, int width, bool reformat) error = xwimp_set_extent(toolbar->toolbar_handle, &extent); if (error) { - LOG("xwimp_get_window_state: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, + "xwimp_get_window_state: 0x%x: %s", + error->errnum, + error->errmess); ro_warn_user("WimpError", error->errmess); } @@ -935,7 +951,7 @@ void ro_toolbar_destroy(struct toolbar *toolbar) if (toolbar == NULL) return; - LOG("Destroying toolbar 0x%x", (unsigned int)toolbar); + NSLOG(netsurf, INFO, "Destroying toolbar 0x%x", (unsigned int)toolbar); /* Destroy the widgets. */ @@ -994,7 +1010,8 @@ void ro_toolbar_redraw(wimp_draw *redraw) error = xwimp_redraw_window(redraw, &more); if (error) { - LOG("xwimp_redraw_window: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_redraw_window: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); return; } @@ -1013,7 +1030,8 @@ void ro_toolbar_redraw(wimp_draw *redraw) error = xwimp_get_rectangle(redraw, &more); if (error) { - LOG("xwimp_get_rectangle: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_get_rectangle: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); return; } @@ -1046,7 +1064,8 @@ bool ro_toolbar_click(wimp_pointer *pointer) state.w = toolbar->toolbar_handle; error = xwimp_get_window_state(&state); if (error) { - LOG("xwimp_get_window_state: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_get_window_state: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); return false; } @@ -1325,7 +1344,8 @@ const char *ro_toolbar_get_help_suffix(wimp_w w, wimp_i i, os_coord *pos, state.w = toolbar->toolbar_handle; error = xwimp_get_window_state(&state); if (error) { - LOG("xwimp_get_window_state: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_get_window_state: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); return NULL; } diff --git a/frontends/riscos/ucstables.c b/frontends/riscos/ucstables.c index 8e538ef95..3e31c992e 100644 --- a/frontends/riscos/ucstables.c +++ b/frontends/riscos/ucstables.c @@ -623,7 +623,8 @@ nserror utf8_from_local_encoding(const char *string, size_t len, char **result) off - prev_off, &temp, NULL); if (err != NSERROR_OK) { assert(err != NSERROR_BAD_ENCODING); - LOG("utf8_from_enc failed"); + NSLOG(netsurf, INFO, + "utf8_from_enc failed"); free(*result); return NSERROR_NOMEM; } @@ -665,7 +666,7 @@ nserror utf8_from_local_encoding(const char *string, size_t len, char **result) &temp, NULL); if (err != NSERROR_OK) { assert(err != NSERROR_BAD_ENCODING); - LOG("utf8_from_enc failed"); + NSLOG(netsurf, INFO, "utf8_from_enc failed"); free(*result); return NSERROR_NOMEM; } @@ -680,7 +681,7 @@ nserror utf8_from_local_encoding(const char *string, size_t len, char **result) /* and copy into more reasonably-sized buffer */ temp = realloc((*result), cur_off + 1); if (!temp) { - LOG("realloc failed"); + NSLOG(netsurf, INFO, "realloc failed"); free(*result); return NSERROR_NOMEM; } diff --git a/frontends/riscos/uri.c b/frontends/riscos/uri.c index a2f126b31..d79cfe56d 100644 --- a/frontends/riscos/uri.c +++ b/frontends/riscos/uri.c @@ -120,7 +120,8 @@ void ro_uri_bounce(wimp_message *msg) /* Get required buffer size */ e = xuri_request_uri(0, NULL, 0, message->handle, &size); if (e) { - LOG("xuri_request_uri: %d: %s", e->errnum, e->errmess); + NSLOG(netsurf, INFO, "xuri_request_uri: %d: %s", e->errnum, + e->errmess); return; } @@ -131,7 +132,8 @@ void ro_uri_bounce(wimp_message *msg) /* Get URI */ e = xuri_request_uri(0, uri_buf, size, message->handle, 0); if (e) { - LOG("xuri_request_uri: %d: %s", e->errnum, e->errmess); + NSLOG(netsurf, INFO, "xuri_request_uri: %d: %s", e->errnum, + e->errmess); free(uri_buf); return; } diff --git a/frontends/riscos/url_complete.c b/frontends/riscos/url_complete.c index 16c6e3a2e..82c2d2c67 100644 --- a/frontends/riscos/url_complete.c +++ b/frontends/riscos/url_complete.c @@ -171,7 +171,8 @@ bool ro_gui_url_complete_keypress(struct toolbar *toolbar, uint32_t key) -(url_complete_matches_selection + 1) * 44, 65536, -url_complete_matches_selection * 44); if (error) { - LOG("xwimp_force_redraw: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_force_redraw: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); } @@ -210,7 +211,10 @@ bool ro_gui_url_complete_keypress(struct toolbar *toolbar, uint32_t key) state.w = parent; error = xwimp_get_window_state(&state); if (error) { - LOG("xwimp_get_window_state: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, + "xwimp_get_window_state: 0x%x: %s", + error->errnum, + error->errmess); ro_warn_user("WimpError", error->errmess); return false; } @@ -228,7 +232,10 @@ bool ro_gui_url_complete_keypress(struct toolbar *toolbar, uint32_t key) error = xwimp_force_redraw(dialog_url_complete, 0, -(i + 1) * 44, 65536, -i * 44); if (error) { - LOG("xwimp_force_redraw: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, + "xwimp_force_redraw: 0x%x: %s", + error->errnum, + error->errmess); ro_warn_user("WimpError", error->errmess); } @@ -281,7 +288,8 @@ bool ro_gui_url_complete_keypress(struct toolbar *toolbar, uint32_t key) 0, -(old_selection + 1) * 44, 65536, -old_selection * 44); if (error) { - LOG("xwimp_force_redraw: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_force_redraw: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); } @@ -289,7 +297,8 @@ bool ro_gui_url_complete_keypress(struct toolbar *toolbar, uint32_t key) 0, -(url_complete_matches_selection + 1) * 44, 65536, -url_complete_matches_selection * 44); if (error) { - LOG("xwimp_force_redraw: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_force_redraw: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); } @@ -320,7 +329,8 @@ bool ro_gui_url_complete_keypress(struct toolbar *toolbar, uint32_t key) state.w = dialog_url_complete; error = xwimp_get_window_state(&state); if (error) { - LOG("xwimp_get_window_state: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_get_window_state: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); return true; } @@ -335,7 +345,8 @@ bool ro_gui_url_complete_keypress(struct toolbar *toolbar, uint32_t key) error = xwimp_open_window(PTR_WIMP_OPEN(&state)); if (error) { - LOG("xwimp_open_window: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_open_window: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); return true; } @@ -411,7 +422,8 @@ void ro_gui_url_complete_resize(struct toolbar *toolbar, wimp_open *open) state.w = dialog_url_complete; error = xwimp_get_window_state(&state); if (error) { - LOG("xwimp_get_window_state: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_get_window_state: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); return; } @@ -423,13 +435,14 @@ void ro_gui_url_complete_resize(struct toolbar *toolbar, wimp_open *open) toolbar_state.w = ro_toolbar_get_window(toolbar); error = xwimp_get_window_state(&toolbar_state); if (error) { - LOG("xwimp_get_window_state: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_get_window_state: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); return; } if (!ro_toolbar_get_url_field_extent(toolbar, &url_extent)) { - LOG("Failed to read URL field extent."); + NSLOG(netsurf, INFO, "Failed to read URL field extent."); return; } @@ -438,7 +451,8 @@ void ro_gui_url_complete_resize(struct toolbar *toolbar, wimp_open *open) extent.x1 = 65536; error = xwimp_set_extent(dialog_url_complete, &extent); if (error) { - LOG("xwimp_set_extent: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_set_extent: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); return; } @@ -460,14 +474,16 @@ void ro_gui_url_complete_resize(struct toolbar *toolbar, wimp_open *open) if (state.visible.x1 - state.visible.x0 < 0) { error = xwimp_close_window(dialog_url_complete); if (error) { - LOG("xwimp_close_window: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_close_window: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); } } else { error = xwimp_open_window_nested_with_flags(&state, (wimp_w)-1, 0); if (error) { - LOG("xwimp_open_window: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_open_window: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); return; } @@ -507,7 +523,8 @@ bool ro_gui_url_complete_close(void) error = xwimp_close_window(dialog_url_complete); if (error) { - LOG("xwimp_close_window: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_close_window: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); } @@ -547,7 +564,7 @@ void ro_gui_url_complete_redraw(wimp_draw *redraw) /* no matches? no redraw */ if (!url_complete_matches) { - LOG("Attempt to redraw with no matches made"); + NSLOG(netsurf, INFO, "Attempt to redraw with no matches made"); /* Fill is never used, so make it something obvious */ ro_gui_user_redraw(redraw, false, os_COLOUR_BLACK); return; @@ -582,7 +599,10 @@ void ro_gui_url_complete_redraw(wimp_draw *redraw) error = xwimp_plot_icon(&url_complete_icon); if (error) { - LOG("xwimp_plot_icon: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, + "xwimp_plot_icon: 0x%x: %s", + error->errnum, + error->errmess); ro_warn_user("WimpError", error->errmess); } @@ -604,7 +624,10 @@ void ro_gui_url_complete_redraw(wimp_draw *redraw) url_complete_sprite.extent.y0 = -(line + 1) * 44; error = xwimp_plot_icon(&url_complete_sprite); if (error) { - LOG("xwimp_plot_icon: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, + "xwimp_plot_icon: 0x%x: %s", + error->errnum, + error->errmess); ro_warn_user("WimpError", error->errmess); } } @@ -658,7 +681,8 @@ bool ro_gui_url_complete_click(wimp_pointer *pointer) state.w = dialog_url_complete; error = xwimp_get_window_state(&state); if (error) { - LOG("xwimp_get_window_state: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_get_window_state: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); return false; } @@ -685,14 +709,16 @@ bool ro_gui_url_complete_click(wimp_pointer *pointer) 0, -(old_selection + 1) * 44, 65536, -old_selection * 44); if (error) { - LOG("xwimp_force_redraw: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_force_redraw: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); } error = xwimp_force_redraw(dialog_url_complete, 0, -(url_complete_matches_selection + 1) * 44, 65536, -url_complete_matches_selection * 44); if (error) { - LOG("xwimp_force_redraw: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_force_redraw: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); } } diff --git a/frontends/riscos/url_protocol.c b/frontends/riscos/url_protocol.c index 9a7ae062c..184aaeab0 100644 --- a/frontends/riscos/url_protocol.c +++ b/frontends/riscos/url_protocol.c @@ -75,17 +75,19 @@ void ro_url_message_received(wimp_message *message) } else { if (!url_message->indirect.url.offset) { - LOG("no URL in message"); + NSLOG(netsurf, INFO, "no URL in message"); return; } if (28 < message->size && url_message->indirect.body_file.offset) { - LOG("POST for URL message not implemented"); + NSLOG(netsurf, INFO, + "POST for URL message not implemented"); return; } if (url_message->indirect.url.offset < 28 || 236 <= url_message->indirect.url.offset) { - LOG("external pointers in URL message unimplemented"); + NSLOG(netsurf, INFO, + "external pointers in URL message unimplemented"); /* these messages have never been seen in the wild, * and there is the problem of invalid addresses which * would cause an abort */ @@ -122,7 +124,8 @@ void ro_url_message_received(wimp_message *message) error = xwimp_send_message(wimp_USER_MESSAGE_ACKNOWLEDGE, message, message->sender); if (error) { - LOG("xwimp_send_message: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_send_message: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); } @@ -165,7 +168,8 @@ void ro_url_broadcast(const char *url) error = xwimp_send_message(wimp_USER_MESSAGE_RECORDED, (wimp_message *) &message, 0); if (error) { - LOG("xwimp_send_message: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_send_message: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); } } @@ -184,7 +188,7 @@ void ro_url_load(const char *url) colon = strchr(url, ':'); if (!colon) { - LOG("invalid url '%s'", url); + NSLOG(netsurf, INFO, "invalid url '%s'", url); return; } @@ -204,7 +208,8 @@ void ro_url_load(const char *url) error = xwimp_start_task(command, 0); if (error) { - LOG("xwimp_start_task: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_start_task: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); } diff --git a/frontends/riscos/wimp.c b/frontends/riscos/wimp.c index abf099a55..d851ab59e 100644 --- a/frontends/riscos/wimp.c +++ b/frontends/riscos/wimp.c @@ -103,7 +103,10 @@ void ro_gui_wimp_cache_furniture_sizes(wimp_w w) furniture_sizes.border_widths.x1 = 40; error = xwimpextend_get_furniture_sizes(&furniture_sizes); if (error) { - LOG("xwimpextend_get_furniture_sizes: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, + "xwimpextend_get_furniture_sizes: 0x%x: %s", + error->errnum, + error->errmess); ro_warn_user("WimpError", error->errmess); } } @@ -123,13 +126,15 @@ bool ro_gui_wimp_read_eig_factors(os_mode mode, int *xeig, int *yeig) error = xos_read_mode_variable(mode, os_MODEVAR_XEIG_FACTOR, xeig, 0); if (error) { - LOG("xos_read_mode_variable: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xos_read_mode_variable: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("MiscError", error->errmess); return false; } error = xos_read_mode_variable(mode, os_MODEVAR_YEIG_FACTOR, yeig, 0); if (error) { - LOG("xos_read_mode_variable: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xos_read_mode_variable: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("MiscError", error->errmess); return false; } @@ -196,14 +201,16 @@ void ro_gui_force_redraw_icon(wimp_w w, wimp_i i) ic.i = i; error = xwimp_get_icon_state(&ic); if (error) { - LOG("xwimp_get_icon_state: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_get_icon_state: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); return; } error = xwimp_force_redraw(w, ic.icon.extent.x0, ic.icon.extent.y0, ic.icon.extent.x1, ic.icon.extent.y1); if (error) { - LOG("xwimp_force_redraw: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_force_redraw: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); } } @@ -235,7 +242,8 @@ const char *ro_gui_get_icon_string(wimp_w w, wimp_i i) ic.i = i; error = xwimp_get_icon_state(&ic); if (error) { - LOG("xwimp_get_icon_state: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_get_icon_state: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); return NULL; } @@ -277,7 +285,7 @@ void ro_gui_set_icon_string(wimp_w w, wimp_i i, const char *text, bool is_utf8) if (err != NSERROR_OK) { /* A bad encoding should never happen, so assert this */ assert(err != NSERROR_BAD_ENCODING); - LOG("utf8_to_enc failed"); + NSLOG(netsurf, INFO, "utf8_to_enc failed"); /* Paranoia */ local_text = NULL; } @@ -292,7 +300,8 @@ void ro_gui_set_icon_string(wimp_w w, wimp_i i, const char *text, bool is_utf8) ic.i = i; error = xwimp_get_icon_state(&ic); if (error) { - LOG("xwimp_get_icon_state: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_get_icon_state: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); goto exit; } @@ -325,7 +334,10 @@ void ro_gui_set_icon_string(wimp_w w, wimp_i i, const char *text, bool is_utf8) (button_type == wimp_BUTTON_WRITE_CLICK_DRAG)) { error = xwimp_get_caret_position(&caret); if (error) { - LOG("xwimp_get_caret_position: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, + "xwimp_get_caret_position: 0x%x: %s", + error->errnum, + error->errmess); ro_warn_user("WimpError", error->errmess); goto exit; } @@ -336,7 +348,10 @@ void ro_gui_set_icon_string(wimp_w w, wimp_i i, const char *text, bool is_utf8) error = xwimp_set_caret_position(w, i, caret.pos.x, caret.pos.y, -1, caret.index); if (error) { - LOG("xwimp_set_caret_position: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, + "xwimp_set_caret_position: 0x%x: %s", + error->errnum, + error->errmess); ro_warn_user("WimpError", error->errmess); } } @@ -433,7 +448,8 @@ void ro_gui_set_icon_selected_state(wimp_w w, wimp_i i, bool state) error = xwimp_set_icon_state(w, i, (state ? wimp_ICON_SELECTED : 0), wimp_ICON_SELECTED); if (error) { - LOG("xwimp_set_icon_state: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_set_icon_state: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); } } @@ -452,7 +468,8 @@ bool ro_gui_get_icon_selected_state(wimp_w w, wimp_i i) ic.i = i; error = xwimp_get_icon_state(&ic); if (error) { - LOG("xwimp_get_icon_state: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_get_icon_state: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); return false; } @@ -478,7 +495,8 @@ void ro_gui_set_icon_shaded_state(wimp_w w, wimp_i i, bool state) error = xwimp_set_icon_state(w, i, (state ? wimp_ICON_SHADED : 0), wimp_ICON_SHADED); if (error) { - LOG("xwimp_get_icon_state: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_get_icon_state: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); } if (!state) @@ -487,7 +505,8 @@ void ro_gui_set_icon_shaded_state(wimp_w w, wimp_i i, bool state) /* ensure the caret is not in a shaded icon */ error = xwimp_get_caret_position(&caret); if (error) { - LOG("xwimp_get_caret_position: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_get_caret_position: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); return; } @@ -499,7 +518,8 @@ void ro_gui_set_icon_shaded_state(wimp_w w, wimp_i i, bool state) /* lose the caret */ error = xwimp_set_caret_position((wimp_w)-1, (wimp_i)-1, -1, -1, -1, -1); if (error) { - LOG("xwimp_set_caret_position: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_set_caret_position: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); return; } @@ -540,7 +560,8 @@ void ro_gui_set_icon_deleted_state(wimp_w w, wimp_i i, bool state) error = xwimp_set_icon_state(w, i, (state ? wimp_ICON_DELETED : 0), wimp_ICON_DELETED); if (error) { - LOG("xwimp_get_icon_state: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_get_icon_state: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); } if (!state) @@ -549,7 +570,8 @@ void ro_gui_set_icon_deleted_state(wimp_w w, wimp_i i, bool state) /* ensure the caret is not in a shaded icon */ error = xwimp_get_caret_position(&caret); if (error) { - LOG("xwimp_get_caret_position: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_get_caret_position: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); return; } @@ -561,7 +583,8 @@ void ro_gui_set_icon_deleted_state(wimp_w w, wimp_i i, bool state) /* lose the caret */ error = xwimp_set_caret_position((wimp_w)-1, (wimp_i)-1, -1, -1, -1, -1); if (error) { - LOG("xwimp_set_caret_position: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_set_caret_position: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); return; } @@ -597,7 +620,8 @@ void ro_gui_set_icon_button_type(wimp_w w, wimp_i i, int type) error = xwimp_set_icon_state(w, i, wimp_ICON_BUTTON_TYPE, (type << wimp_ICON_BUTTON_TYPE_SHIFT)); if (error) { - LOG("xwimp_set_icon_state: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_set_icon_state: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); } } @@ -622,7 +646,8 @@ void ro_gui_set_icon_sprite(wimp_w w, wimp_i i, osspriteop_area *area, ic.i = i; error = xwimp_get_icon_state(&ic); if (error) { - LOG("xwimp_get_icon_state: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_get_icon_state: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); return; } @@ -659,7 +684,8 @@ void ro_gui_set_window_title(wimp_w w, const char *text) window.w = w; error = xwimp_get_window_info_header_only((wimp_window_info *)&window); if (error) { - LOG("xwimp_get_window_info: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_get_window_info: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); return; } @@ -670,7 +696,7 @@ void ro_gui_set_window_title(wimp_w w, const char *text) /* A bad encoding should never happen, * so assert this */ assert(err != NSERROR_BAD_ENCODING); - LOG("utf8_to_enc failed"); + NSLOG(netsurf, INFO, "utf8_to_enc failed"); return; } @@ -686,7 +712,8 @@ void ro_gui_set_window_title(wimp_w w, const char *text) */ error = xwimp_force_redraw_title(w); if (error) { - LOG("xwimp_force_redraw_title: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_force_redraw_title: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); return; } @@ -713,7 +740,8 @@ bool ro_gui_set_caret_first(wimp_w w) win_state.w = w; error = xwimp_get_window_state(&win_state); if (error) { - LOG("xwimp_get_window_state: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_get_window_state: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); return false; } @@ -724,7 +752,8 @@ bool ro_gui_set_caret_first(wimp_w w) window.w = w; error = xwimp_get_window_info_header_only((wimp_window_info *)&window); if (error) { - LOG("xwimp_get_window_info: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_get_window_info: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); return false; } @@ -735,7 +764,10 @@ bool ro_gui_set_caret_first(wimp_w w) state.i = icon; error = xwimp_get_icon_state(&state); if (error) { - LOG("xwimp_get_icon_state: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, + "xwimp_get_icon_state: 0x%x: %s", + error->errnum, + error->errmess); ro_warn_user("WimpError", error->errmess); return false; } @@ -752,7 +784,10 @@ bool ro_gui_set_caret_first(wimp_w w) error = xwimp_set_caret_position(w, icon, 0, 0, -1, strlen(state.icon.data.indirected_text.text)); if (error) { - LOG("xwimp_set_caret_position: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, + "xwimp_set_caret_position: 0x%x: %s", + error->errnum, + error->errmess); ro_warn_user("WimpError", error->errmess); } return true; @@ -778,7 +813,10 @@ osspriteop_area *ro_gui_load_sprite_file(const char *pathname) error = xosfile_read_stamped_no_path(pathname, &obj_type, 0, 0, &len, 0, 0); if (error) { - LOG("xosfile_read_stamped_no_path: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, + "xosfile_read_stamped_no_path: 0x%x: %s", + error->errnum, + error->errmess); ro_warn_user("MiscError", error->errmess); return 0; } @@ -801,7 +839,10 @@ osspriteop_area *ro_gui_load_sprite_file(const char *pathname) error = xosspriteop_load_sprite_file(osspriteop_USER_AREA, area, pathname); if (error) { - LOG("xosspriteop_load_sprite_file: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, + "xosspriteop_load_sprite_file: 0x%x: %s", + error->errnum, + error->errmess); ro_warn_user("MiscError", error->errmess); free(area); return 0; @@ -831,7 +872,10 @@ bool ro_gui_wimp_sprite_exists(const char *sprite) error = xwimpspriteop_select_sprite(sprite, 0); if (error) { if (error->errnum != error_SPRITE_OP_DOESNT_EXIST) { - LOG("xwimpspriteop_select_sprite: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, + "xwimpspriteop_select_sprite: 0x%x: %s", + error->errnum, + error->errmess); ro_warn_user("MiscError", error->errmess); } return false; @@ -904,7 +948,10 @@ bool ro_gui_wimp_get_sprite_dimensions(osspriteop_area *area, char *sprite, if (height != NULL) *height = dimensions.y; } else if (error->errnum != error_SPRITE_OP_DOESNT_EXIST) { - LOG("xosspriteop_read_sprite_info: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, + "xosspriteop_read_sprite_info: 0x%x: %s", + error->errnum, + error->errmess); ro_warn_user("MiscError", error->errmess); return false; } @@ -929,7 +976,8 @@ void ro_gui_user_redraw(wimp_draw *redraw, bool user_fill, error = xwimp_redraw_window(redraw, &more); if (error) { - LOG("xwimp_redraw_window: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_redraw_window: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); return; } @@ -939,14 +987,18 @@ void ro_gui_user_redraw(wimp_draw *redraw, bool user_fill, colourtrans_SET_BG_GCOL, os_ACTION_OVERWRITE, 0, 0); if (error) { - LOG("xcolourtrans_set_gcol: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, + "xcolourtrans_set_gcol: 0x%x: %s", + error->errnum, + error->errmess); ro_warn_user("MiscError", error->errmess); } os_clg(); } error = xwimp_get_rectangle(redraw, &more); if (error) { - LOG("xwimp_get_rectangle: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_get_rectangle: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); return; } @@ -973,7 +1025,8 @@ void ro_gui_wimp_update_window_furniture(wimp_w w, wimp_window_flags bic_mask, state.w = w; error = xwimp_get_window_state_and_nesting(&state, &parent, &linkage); if (error) { - LOG("xwimp_get_window_state: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_get_window_state: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); return; } @@ -986,7 +1039,8 @@ void ro_gui_wimp_update_window_furniture(wimp_w w, wimp_window_flags bic_mask, state.next = wimp_HIDDEN; error = xwimp_open_window_nested_with_flags(&state, parent, linkage); if (error) { - LOG("xwimp_open_window: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_open_window: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); return; } @@ -994,7 +1048,8 @@ void ro_gui_wimp_update_window_furniture(wimp_w w, wimp_window_flags bic_mask, if (!open) { error = xwimp_close_window(w); if (error) { - LOG("xwimp_close_window: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_close_window: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); return; } @@ -1016,7 +1071,8 @@ bool ro_gui_wimp_check_window_furniture(wimp_w w, wimp_window_flags mask) state.w = w; error = xwimp_get_window_state(&state); if (error) { - LOG("xwimp_get_window_state: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_get_window_state: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); return false; } @@ -1116,7 +1172,8 @@ void ro_gui_scroll(wimp_scroll *scroll) error = xwimp_open_window((wimp_open *) scroll); if (error) { - LOG("xwimp_open_window: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_open_window: 0x%x: %s", + error->errnum, error->errmess); } } diff --git a/frontends/riscos/wimp_event.c b/frontends/riscos/wimp_event.c index 015e87baf..cdca470da 100644 --- a/frontends/riscos/wimp_event.c +++ b/frontends/riscos/wimp_event.c @@ -156,7 +156,9 @@ bool ro_gui_wimp_event_memorise(wimp_w w) ro_gui_get_icon_string(window->w, event->i)); if (!event->previous_value.textual) { error = true; - LOG("Unable to store state for icon %i", event->i); + NSLOG(netsurf, INFO, + "Unable to store state for icon %i", + event->i); } break; case EVENT_CHECKBOX: @@ -267,7 +269,10 @@ bool ro_gui_wimp_event_transfer(wimp_w from, wimp_w to) struct event_window *window; int h; - LOG("Transferring all events from window 0x%x to window 0x%x", (unsigned int)from, (unsigned int)to); + NSLOG(netsurf, INFO, + "Transferring all events from window 0x%x to window 0x%x", + (unsigned int)from, + (unsigned int)to); window = ro_gui_wimp_event_remove_window(from); if (window == NULL || window->w != from) @@ -293,7 +298,8 @@ void ro_gui_wimp_event_finalise(wimp_w w) struct event_window *window; struct icon_event *event; - LOG("Removing all events for window 0x%x", (unsigned int)w); + NSLOG(netsurf, INFO, "Removing all events for window 0x%x", + (unsigned int)w); window = ro_gui_wimp_event_remove_window(w); if (!window) return; @@ -330,7 +336,8 @@ void ro_gui_wimp_event_deregister(wimp_w w, wimp_i i) struct event_window *window; struct icon_event *event, *parent, *child; - LOG("Removing all events for window 0x%x, icon %d", (unsigned int)w, (int)i); + NSLOG(netsurf, INFO, "Removing all events for window 0x%x, icon %d", + (unsigned int)w, (int)i); window = ro_gui_wimp_event_get_window(w); if (!window) return; @@ -344,7 +351,8 @@ void ro_gui_wimp_event_deregister(wimp_w w, wimp_i i) child = event->next; if (event->i == i) { - LOG("Removing event 0x%x", (unsigned int)event); + NSLOG(netsurf, INFO, "Removing event 0x%x", + (unsigned int)event); if (parent == NULL) window->first = child; @@ -576,7 +584,8 @@ bool ro_gui_wimp_event_menu_selection(wimp_w w, wimp_i i, wimp_menu *menu, ic.i = event->data.menu_gright.field; error = xwimp_get_icon_state(&ic); if (error) { - LOG("xwimp_get_icon_state: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_get_icon_state: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); return false; } @@ -586,7 +595,8 @@ bool ro_gui_wimp_event_menu_selection(wimp_w w, wimp_i i, wimp_menu *menu, return prepared; error = xwimp_get_caret_position(&caret); if (error) { - LOG("xwimp_get_caret_position: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_get_caret_position: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); return false; } @@ -594,7 +604,10 @@ bool ro_gui_wimp_event_menu_selection(wimp_w w, wimp_i i, wimp_menu *menu, error = xwimp_set_caret_position(window->w, event->data.menu_gright.field, -1, -1, -1, strlen(menu_entry->data.indirected_text.text)); if (error) { - LOG("xwimp_set_caret_position: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, + "xwimp_set_caret_position: 0x%x: %s", + error->errnum, + error->errmess); ro_warn_user("WimpError", error->errmess); } } @@ -666,7 +679,7 @@ bool ro_gui_wimp_event_mouse_click(wimp_pointer *pointer) for (search = window->first; search; search = search->next) if (search->i == event->data.linked_icon) break; if (!search) { - LOG("Incorrect reference."); + NSLOG(netsurf, INFO, "Incorrect reference."); return false; } stepping = search->data.numeric_field.stepping; @@ -703,13 +716,19 @@ bool ro_gui_wimp_event_mouse_click(wimp_pointer *pointer) open.w = pointer->w; error = xwimp_get_window_state(&open); if (error) { - LOG("xwimp_get_window_state: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, + "xwimp_get_window_state: 0x%x: %s", + error->errnum, + error->errmess); ro_warn_user("WimpError", error->errmess); return false; } error = xwimp_get_caret_position(&caret); if (error) { - LOG("xwimp_get_caret_position: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, + "xwimp_get_caret_position: 0x%x: %s", + error->errnum, + error->errmess); ro_warn_user("WimpError", error->errmess); return false; } @@ -718,7 +737,10 @@ bool ro_gui_wimp_event_mouse_click(wimp_pointer *pointer) ro_gui_menu_destroy(); error = xwimp_open_window(PTR_WIMP_OPEN(&open)); if (error) { - LOG("xwimp_open_window: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, + "xwimp_open_window: 0x%x: %s", + error->errnum, + error->errmess); ro_warn_user("WimpError", error->errmess); return false; } @@ -728,7 +750,10 @@ bool ro_gui_wimp_event_mouse_click(wimp_pointer *pointer) caret.pos.x, caret.pos.y, -1, caret.index); if (error) { - LOG("xwimp_set_caret_position: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, + "xwimp_set_caret_position: 0x%x: %s", + error->errnum, + error->errmess); ro_warn_user("WimpError", error->errmess); } } @@ -796,7 +821,8 @@ void ro_gui_wimp_event_prepare_gright_menu(wimp_w w, struct icon_event *event) ic.i = event->data.menu_gright.field; error = xwimp_get_icon_state(&ic); if (error) { - LOG("xwimp_get_icon_state: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_get_icon_state: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); return; } @@ -903,7 +929,8 @@ bool ro_gui_wimp_event_keypress(wimp_key *key) */ error = xosbyte1(osbyte_ALPHABET_NUMBER, 127, 0, &t_alphabet); if (error) { - LOG("failed reading alphabet: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "failed reading alphabet: 0x%x: %s", + error->errnum, error->errmess); /* prevent any corruption of ucstable */ t_alphabet = alphabet; } @@ -917,7 +944,10 @@ bool ro_gui_wimp_event_keypress(wimp_key *key) error = xserviceinternational_get_ucs_conversion_table( alphabet, &unclaimed, &ostable); if (error != NULL) { - LOG("failed reading UCS conversion table: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, + "failed reading UCS conversion table: 0x%x: %s", + error->errnum, + error->errmess); /* Try using our own table instead */ ucstable = ucstable_from_alphabet(alphabet); } else if (unclaimed) { @@ -974,7 +1004,9 @@ bool ro_gui_wimp_event_keypress(wimp_key *key) /* If this ever happens, * RISC OS' UTF8 keyboard * drivers are broken */ - LOG("unexpected UTF8 start"" byte %x (ignoring)", c); + NSLOG(netsurf, INFO, + "unexpected UTF8 start"" byte %x (ignoring)", + c); return true; } /* Anything else is ASCII, so just @@ -985,7 +1017,9 @@ bool ro_gui_wimp_event_keypress(wimp_key *key) /* If this ever happens, * RISC OS' UTF8 keyboard * drivers are broken */ - LOG("unexpected keycode: ""%x (ignoring)", c); + NSLOG(netsurf, INFO, + "unexpected keycode: ""%x (ignoring)", + c); return true; } @@ -1074,7 +1108,8 @@ bool ro_gui_wimp_event_close_window(wimp_w w) { struct event_window *window; - LOG("Close event received for window 0x%x", (unsigned int)w); + NSLOG(netsurf, INFO, "Close event received for window 0x%x", + (unsigned int)w); if (w == ro_gui_wimp_event_submenu) ro_gui_wimp_event_submenu = 0; window = ro_gui_wimp_event_find_window(w); @@ -1615,7 +1650,8 @@ struct event_window *ro_gui_wimp_event_get_window(wimp_w w) if (window) return window; - LOG("Creating structure for window 0x%x", (unsigned int)w); + NSLOG(netsurf, INFO, "Creating structure for window 0x%x", + (unsigned int)w); window = calloc(1, sizeof(struct event_window)); if (!window) return NULL; diff --git a/frontends/riscos/window.c b/frontends/riscos/window.c index 6dbcc325b..986e5c55d 100644 --- a/frontends/riscos/window.c +++ b/frontends/riscos/window.c @@ -206,7 +206,8 @@ gui_window_place_caret(struct gui_window *g, error = xwimp_set_caret_position(g->window, -1, x * 2, -(y + height) * 2, height * 2, -1); if (error) { - LOG("xwimp_set_caret_position: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_set_caret_position: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); } } @@ -235,7 +236,10 @@ static void gui_window_set_extent(struct gui_window *g, int width, int height) state.w = g->window; error = xwimp_get_window_state(&state); if (error) { - LOG("xwimp_get_window_state: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, + "xwimp_get_window_state: 0x%x: %s", + error->errnum, + error->errmess); ro_warn_user("WimpError", error->errmess); return; } @@ -266,7 +270,8 @@ static void gui_window_set_extent(struct gui_window *g, int width, int height) os_box extent = { 0, -height, width, toolbar_height }; error = xwimp_set_extent(g->window, &extent); if (error) { - LOG("xwimp_set_extent: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_set_extent: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); return; } @@ -309,7 +314,8 @@ static void ro_gui_window_open(wimp_open *open) state.w = g->window; error = xwimp_get_window_state_and_nesting(&state, &parent, &linkage); if (error) { - LOG("xwimp_get_window_state: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_get_window_state: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); return; } @@ -414,7 +420,8 @@ static void ro_gui_window_open(wimp_open *open) error = xwimp_open_window_nested_with_flags(&state, parent, linkage); if (error) { - LOG("xwimp_open_window: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_open_window: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); return; } @@ -453,8 +460,10 @@ static void gui_window_update_extent(struct gui_window *g) info.w = g->window; error = xwimp_get_window_info_header_only(&info); if (error) { - LOG("xwimp_get_window_info_header_only: 0x%x: %s", - error->errnum, error->errmess); + NSLOG(netsurf, INFO, + "xwimp_get_window_info_header_only: 0x%x: %s", + error->errnum, + error->errmess); ro_warn_user("WimpError", error->errmess); return; } @@ -1046,7 +1055,8 @@ ro_gui_window_scroll_action(struct gui_window *g, state.w = g->window; error = xwimp_get_window_state(&state); if (error) { - LOG("xwimp_get_window_state: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_get_window_state: 0x%x: %s", + error->errnum, error->errmess); return; } @@ -1060,7 +1070,8 @@ ro_gui_window_scroll_action(struct gui_window *g, error = xwimp_get_pointer_info(&pointer); if (error) { - LOG("xwimp_get_pointer_info 0x%x : %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_get_pointer_info 0x%x : %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); return; } @@ -1180,7 +1191,8 @@ ro_gui_window_scroll_action(struct gui_window *g, error = xwimp_open_window((wimp_open *) &state); if (error) { - LOG("xwimp_open_window: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_open_window: 0x%x: %s", + error->errnum, error->errmess); } } } @@ -1218,7 +1230,8 @@ ro_gui_window_handle_local_keypress(struct gui_window *g, ro_error = xwimp_get_pointer_info(&pointer); if (ro_error) { - LOG("xwimp_get_pointer_info: 0x%x: %s\n", ro_error->errnum, ro_error->errmess); + NSLOG(netsurf, INFO, "xwimp_get_pointer_info: 0x%x: %s\n", + ro_error->errnum, ro_error->errmess); ro_warn_user("WimpError", ro_error->errmess); return false; } @@ -1528,8 +1541,8 @@ static void ro_gui_window_close(wimp_w w) error = xwimp_get_pointer_info(&pointer); if (error) { - LOG("xwimp_get_pointer_info: 0x%x: %s", - error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_get_pointer_info: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); return; } @@ -1559,7 +1572,10 @@ static void ro_gui_window_close(wimp_w w) } error = xos_cli(temp_name); if (error) { - LOG("xos_cli: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, + "xos_cli: 0x%x: %s", + error->errnum, + error->errmess); ro_warn_user("MiscError", error->errmess); return; } @@ -1611,7 +1627,8 @@ static void ro_gui_window_redraw(wimp_draw *redraw) error = xwimp_redraw_window(redraw, &more); if (error) { - LOG("xwimp_redraw_window: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_redraw_window: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); return; } @@ -1653,7 +1670,8 @@ static void ro_gui_window_redraw(wimp_draw *redraw) if (error && !(ro_gui_current_redraw_gui-> option.buffer_everything && error->errnum == error_WIMP_GET_RECT)) { - LOG("xwimp_get_rectangle: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_get_rectangle: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); ro_gui_current_redraw_gui = NULL; return; @@ -1971,7 +1989,7 @@ ro_gui_window_prepare_form_select_menu(struct gui_window *g, if (err != NSERROR_OK) { /* badenc should never happen */ assert(err != NSERROR_BAD_ENCODING); - LOG("utf8_to_local_encoding failed"); + NSLOG(netsurf, INFO, "utf8_to_local_encoding failed"); ro_warn_user("NoMemory", 0); ro_gui_menu_destroy(); return false; @@ -1997,7 +2015,7 @@ ro_gui_window_prepare_form_select_menu(struct gui_window *g, temp = cnv_space2nbsp(option->text); if (!temp) { - LOG("cnv_space2nbsp failed"); + NSLOG(netsurf, INFO, "cnv_space2nbsp failed"); ro_warn_user("NoMemory", 0); ro_gui_menu_destroy(); return false; @@ -2009,7 +2027,7 @@ ro_gui_window_prepare_form_select_menu(struct gui_window *g, /* A bad encoding should never happen, * so assert this */ assert(err != NSERROR_BAD_ENCODING); - LOG("utf8_to_enc failed"); + NSLOG(netsurf, INFO, "utf8_to_enc failed"); ro_warn_user("NoMemory", 0); ro_gui_menu_destroy(); return false; @@ -2831,7 +2849,10 @@ ro_gui_window_menu_select(wimp_w w, state.w = w; oserror = xwimp_get_window_state(&state); if (oserror) { - LOG("xwimp_get_window_state: 0x%x: %s", oserror->errnum, oserror->errmess); + NSLOG(netsurf, INFO, + "xwimp_get_window_state: 0x%x: %s", + oserror->errnum, + oserror->errmess); ro_warn_user("WimpError", oserror->errmess); } nsoption_set_int(window_x, state.visible.x0); @@ -3209,7 +3230,10 @@ static struct gui_window *gui_window_create(struct browser_window *bw, state.w = existing->window; error = xwimp_get_window_state(&state); if (error) { - LOG("xwimp_get_window_state: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, + "xwimp_get_window_state: 0x%x: %s", + error->errnum, + error->errmess); ro_warn_user("WimpError", error->errmess); } window.visible.x0 = state.visible.x0; @@ -3313,7 +3337,8 @@ static struct gui_window *gui_window_create(struct browser_window *bw, error = xwimp_create_window(&window, &g->window); if (error) { - LOG("xwimp_create_window: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_create_window: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); free(g); return 0; @@ -3382,8 +3407,8 @@ static struct gui_window *gui_window_create(struct browser_window *bw, state.w = g->window; error = xwimp_get_window_state(&state); if (error) { - LOG("xwimp_get_window_state: 0x%x: %s", - error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_get_window_state: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); return g; } @@ -3459,7 +3484,8 @@ static void gui_window_destroy(struct gui_window *g) /* delete window */ error = xwimp_delete_window(w); if (error) { - LOG("xwimp_delete_window: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_delete_window: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); } ro_gui_wimp_event_finalise(w); @@ -3515,7 +3541,8 @@ static bool gui_window_get_scroll(struct gui_window *g, int *sx, int *sy) state.w = g->window; error = xwimp_get_window_state(&state); if (error) { - LOG("xwimp_get_window_state: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_get_window_state: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); return false; } @@ -3550,8 +3577,8 @@ gui_window_set_scroll(struct gui_window *g, const struct rect *rect) state.w = g->window; error = xwimp_get_window_state(&state); if (error) { - LOG("xwimp_get_window_state: 0x%x: %s", - error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_get_window_state: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); return NSERROR_BAD_PARAMETER; } @@ -3731,8 +3758,8 @@ static void gui_window_remove_caret(struct gui_window *g) error = xwimp_get_caret_position(&caret); if (error) { - LOG("xwimp_get_caret_position: 0x%x: %s", - error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_get_caret_position: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); return; } @@ -3776,20 +3803,25 @@ static void ro_gui_window_scroll_end(wimp_dragged *drag, void *data) error = xwimp_drag_box((wimp_drag*)-1); if (error) { - LOG("xwimp_drag_box: 0x%x : %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_drag_box: 0x%x : %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); } error = xwimp_get_pointer_info(&pointer); if (error) { - LOG("xwimp_get_pointer_info 0x%x : %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_get_pointer_info 0x%x : %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); return; } error = xwimpspriteop_set_pointer_shape("ptr_default", 0x31, 0, 0, 0, 0); if (error) { - LOG("xwimpspriteop_set_pointer_shape: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, + "xwimpspriteop_set_pointer_shape: 0x%x: %s", + error->errnum, + error->errmess); ro_warn_user("WimpError", error->errmess); } @@ -3814,7 +3846,8 @@ static bool gui_window_scroll_start(struct gui_window *g) error = xwimp_get_pointer_info(&pointer); if (error) { - LOG("xwimp_get_pointer_info 0x%x : %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_get_pointer_info 0x%x : %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); return false; } @@ -3822,7 +3855,8 @@ static bool gui_window_scroll_start(struct gui_window *g) info.w = g->window; error = xwimp_get_window_info_header_only((wimp_window_info*)&info); if (error) { - LOG("xwimp_get_window_state: 0x%x : %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_get_window_state: 0x%x : %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); return false; } @@ -3844,7 +3878,8 @@ static bool gui_window_scroll_start(struct gui_window *g) error = xwimp_drag_box(&drag); if (error) { - LOG("xwimp_drag_box: 0x%x : %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_drag_box: 0x%x : %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); return false; } @@ -3876,7 +3911,10 @@ gui_window_drag_start(struct gui_window *g, * duration */ os_error *error = xwimp_get_pointer_info(&pointer); if (error) { - LOG("xwimp_get_pointer_info 0x%x : %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, + "xwimp_get_pointer_info 0x%x : %s", + error->errnum, + error->errmess); ro_warn_user("WimpError", error->errmess); return false; } @@ -3893,7 +3931,8 @@ gui_window_drag_start(struct gui_window *g, error = xwimp_drag_box(&drag); if (error) { - LOG("xwimp_drag_box: 0x%x : %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_drag_box: 0x%x : %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); return false; } @@ -3955,7 +3994,8 @@ gui_window_create_form_select_menu(struct gui_window *g, error = xwimp_get_pointer_info(&pointer); if (error) { - LOG("xwimp_get_pointer_info: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_get_pointer_info: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); ro_gui_menu_destroy(); return; @@ -3988,7 +4028,8 @@ ro_gui_window_import_text(struct gui_window *g, const char *filename) error = xosfile_read_stamped(filename, &obj_type, NULL, NULL, &size, NULL, NULL); if (error) { - LOG("xosfile_read_stamped: 0x%x:%s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xosfile_read_stamped: 0x%x:%s", + error->errnum, error->errmess); ro_warn_user("FileError", error->errmess); return true; /* was for us, but it didn't work! */ } @@ -4007,7 +4048,8 @@ ro_gui_window_import_text(struct gui_window *g, const char *filename) NULL, NULL, NULL, NULL, NULL); if (error) { - LOG("xosfile_load_stamped: 0x%x:%s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xosfile_load_stamped: 0x%x:%s", + error->errnum, error->errmess); ro_warn_user("LoadError", error->errmess); free(buf); return true; @@ -4017,7 +4059,7 @@ ro_gui_window_import_text(struct gui_window *g, const char *filename) if (ret != NSERROR_OK) { /* bad encoding shouldn't happen */ assert(ret != NSERROR_BAD_ENCODING); - LOG("utf8_from_local_encoding failed"); + NSLOG(netsurf, INFO, "utf8_from_local_encoding failed"); free(buf); ro_warn_user("NoMemory", NULL); return true; @@ -4206,8 +4248,10 @@ ro_gui_window_invalidate_area(struct gui_window *g, const struct rect *rect) info.w = g->window; error = xwimp_get_window_info_header_only(&info); if (error) { - LOG("xwimp_get_window_info_header_only: 0x%x: %s", - error->errnum, error->errmess); + NSLOG(netsurf, INFO, + "xwimp_get_window_info_header_only: 0x%x: %s", + error->errnum, + error->errmess); ro_warn_user("WimpError", error->errmess); return NSERROR_INVALID; } @@ -4216,8 +4260,8 @@ ro_gui_window_invalidate_area(struct gui_window *g, const struct rect *rect) info.extent.x0, info.extent.y0, info.extent.x1, info.extent.y1); if (error) { - LOG("xwimp_force_redraw: 0x%x: %s", - error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_force_redraw: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); return NSERROR_INVALID; } @@ -4251,7 +4295,7 @@ ro_gui_window_invalidate_area(struct gui_window *g, const struct rect *rect) } cur = malloc(sizeof(struct update_box)); if (!cur) { - LOG("No memory for malloc."); + NSLOG(netsurf, INFO, "No memory for malloc."); return NSERROR_NOMEM; } @@ -4323,7 +4367,8 @@ bool ro_gui_window_dataload(struct gui_window *g, wimp_message *message) message->your_ref = message->my_ref; error = xwimp_send_message(wimp_USER_MESSAGE, message, message->sender); if (error) { - LOG("xwimp_send_message: 0x%x: %s\n", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_send_message: 0x%x: %s\n", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); } @@ -4375,12 +4420,14 @@ ro_gui_window_iconise(struct gui_window *g, wimp_full_message_window_info *wi) (osspriteop_id)overlay, &width, &height, NULL, NULL); if (error) { - LOG("xosspriteop_read_sprite_info: 0x%x: %s", - error->errnum, error->errmess); + NSLOG(netsurf, INFO, + "xosspriteop_read_sprite_info: 0x%x: %s", + error->errnum, + error->errmess); ro_warn_user("MiscError", error->errmess); overlay = NULL; } else if (sprite_bpp(overlay) != 8) { - LOG("overlay sprite is not 8bpp"); + NSLOG(netsurf, INFO, "overlay sprite is not 8bpp"); overlay = NULL; } } @@ -4389,7 +4436,7 @@ ro_gui_window_iconise(struct gui_window *g, wimp_full_message_window_info *wi) bitmap = riscos_bitmap_create(width, height, BITMAP_NEW | BITMAP_OPAQUE | BITMAP_CLEAR_MEMORY); if (!bitmap) { - LOG("Thumbnail initialisation failed."); + NSLOG(netsurf, INFO, "Thumbnail initialisation failed."); return; } riscos_bitmap_render(bitmap, h); @@ -4399,7 +4446,7 @@ ro_gui_window_iconise(struct gui_window *g, wimp_full_message_window_info *wi) area = riscos_bitmap_convert_8bpp(bitmap); riscos_bitmap_destroy(bitmap); if (!area) { - LOG("Thumbnail conversion failed."); + NSLOG(netsurf, INFO, "Thumbnail conversion failed."); return; } @@ -4420,7 +4467,8 @@ ro_gui_window_iconise(struct gui_window *g, wimp_full_message_window_info *wi) error = xosspriteop_save_sprite_file(osspriteop_USER_AREA, area, temp_fname); if (error) { - LOG("xosspriteop_save_sprite_file: 0x%x:%s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xosspriteop_save_sprite_file: 0x%x:%s", + error->errnum, error->errmess); ro_warn_user("MiscError", error->errmess); free(area); return; @@ -4428,7 +4476,10 @@ ro_gui_window_iconise(struct gui_window *g, wimp_full_message_window_info *wi) error = xwimpspriteop_merge_sprite_file(temp_fname); if (error) { - LOG("xwimpspriteop_merge_sprite_file: 0x%x:%s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, + "xwimpspriteop_merge_sprite_file: 0x%x:%s", + error->errnum, + error->errmess); ro_warn_user("WimpError", error->errmess); remove(temp_fname); free(area); @@ -4453,7 +4504,8 @@ ro_gui_window_iconise(struct gui_window *g, wimp_full_message_window_info *wi) error = xwimp_send_message(wimp_USER_MESSAGE, (wimp_message*)wi, wi->sender); if (error) { - LOG("xwimp_send_message: 0x%x:%s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_send_message: 0x%x:%s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); } else { @@ -4479,7 +4531,10 @@ bool ro_gui_toolbar_dataload(struct gui_window *g, wimp_message *message) error = xwimp_send_message(wimp_USER_MESSAGE, message, message->sender); if (error) { - LOG("xwimp_send_message: 0x%x: %s\n", error->errnum, error->errmess); + NSLOG(netsurf, INFO, + "xwimp_send_message: 0x%x: %s\n", + error->errnum, + error->errmess); ro_warn_user("WimpError", error->errmess); } return true; @@ -4536,7 +4591,8 @@ void ro_gui_window_update_boxes(void) error = xwimp_update_window(&update, &more); if (error) { - LOG("xwimp_update_window: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_update_window: 0x%x: %s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); continue; } @@ -4569,7 +4625,10 @@ void ro_gui_window_update_boxes(void) * found. This appears to be a bug in RISC OS. */ if (error && !(use_buffer && error->errnum == error_WIMP_GET_RECT)) { - LOG("xwimp_get_rectangle: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, + "xwimp_get_rectangle: 0x%x: %s", + error->errnum, + error->errmess); ro_warn_user("WimpError", error->errmess); ro_gui_current_redraw_gui = NULL; continue; @@ -4685,7 +4744,8 @@ ro_gui_window_to_window_pos(struct gui_window *g, int x, int y, os_coord *pos) state.w = g->window; error = xwimp_get_window_state(&state); if (error) { - LOG("xwimp_get_window_state: 0x%x:%s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_get_window_state: 0x%x:%s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); return false; } @@ -4709,7 +4769,8 @@ bool ro_gui_window_to_screen_pos(struct gui_window *g, state.w = g->window; error = xwimp_get_window_state(&state); if (error) { - LOG("xwimp_get_window_state: 0x%x:%s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "xwimp_get_window_state: 0x%x:%s", + error->errnum, error->errmess); ro_warn_user("WimpError", error->errmess); return false; } @@ -4913,7 +4974,10 @@ void gui_window_set_pointer(struct gui_window *g, gui_pointer_shape shape) error = xwimpspriteop_set_pointer_shape(entry->sprite_name, 1, entry->xactive, entry->yactive, 0, 0); if (error) { - LOG("xwimpspriteop_set_pointer_shape: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, + "xwimpspriteop_set_pointer_shape: 0x%x: %s", + error->errnum, + error->errmess); ro_warn_user("WimpError", error->errmess); } } else { @@ -4923,7 +4987,10 @@ void gui_window_set_pointer(struct gui_window *g, gui_pointer_shape shape) (osspriteop_id) entry->sprite_name, 1, entry->xactive, entry->yactive, 0, 0); if (error) { - LOG("xosspriteop_set_pointer_shape: 0x%x: %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, + "xosspriteop_set_pointer_shape: 0x%x: %s", + error->errnum, + error->errmess); ro_warn_user("WimpError", error->errmess); } } diff --git a/frontends/windows/about.c b/frontends/windows/about.c index 65c81cd7d..2cd855b55 100644 --- a/frontends/windows/about.c +++ b/frontends/windows/about.c @@ -52,7 +52,7 @@ static BOOL init_about_dialog(HWND hwnd) hFont=CreateFont (26, 0, 0, 0, FW_BOLD, FALSE, FALSE, FALSE, ANSI_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH | FF_SWISS, "Arial"); if (hFont != NULL) { - LOG("Setting font object"); + NSLOG(netsurf, INFO, "Setting font object"); SendMessage(dlg_itm, WM_SETFONT, (WPARAM)hFont, 0); } @@ -85,7 +85,7 @@ static BOOL destroy_about_dialog(HWND hwnd) if (dlg_itm != NULL) { hFont = (HFONT)SendMessage(dlg_itm, WM_GETFONT, 0, 0); if (hFont != NULL) { - LOG("Destroyed font object"); + NSLOG(netsurf, INFO, "Destroyed font object"); DeleteObject(hFont); } } @@ -107,12 +107,12 @@ nsws_about_event_callback(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) case WM_COMMAND: switch(LOWORD(wparam)) { case IDOK: - LOG("OK clicked"); + NSLOG(netsurf, INFO, "OK clicked"); EndDialog(hwnd, IDOK); break; case IDCANCEL: - LOG("Cancel clicked"); + NSLOG(netsurf, INFO, "Cancel clicked"); EndDialog(hwnd, IDOK); break; diff --git a/frontends/windows/bitmap.c b/frontends/windows/bitmap.c index f60dab613..1266adb61 100644 --- a/frontends/windows/bitmap.c +++ b/frontends/windows/bitmap.c @@ -52,7 +52,8 @@ void *win32_bitmap_create(int width, int height, unsigned int state) HBITMAP windib; uint8_t *pixdata; - LOG("width %d, height %d, state %u", width, height, state); + NSLOG(netsurf, INFO, "width %d, height %d, state %u", width, height, + state); pbmi = calloc(1, sizeof(BITMAPV5HEADER)); if (pbmi == NULL) { @@ -96,7 +97,7 @@ void *win32_bitmap_create(int width, int height, unsigned int state) bitmap->opaque = false; } - LOG("bitmap %p", bitmap); + NSLOG(netsurf, INFO, "bitmap %p", bitmap); return bitmap; } @@ -115,7 +116,7 @@ static unsigned char *bitmap_get_buffer(void *bitmap) { struct bitmap *bm = bitmap; if (bitmap == NULL) { - LOG("NULL bitmap!"); + NSLOG(netsurf, INFO, "NULL bitmap!"); return NULL; } @@ -134,7 +135,7 @@ static size_t bitmap_get_rowstride(void *bitmap) struct bitmap *bm = bitmap; if (bitmap == NULL) { - LOG("NULL bitmap!"); + NSLOG(netsurf, INFO, "NULL bitmap!"); return 0; } @@ -152,7 +153,7 @@ void win32_bitmap_destroy(void *bitmap) struct bitmap *bm = bitmap; if (bitmap == NULL) { - LOG("NULL bitmap!"); + NSLOG(netsurf, INFO, "NULL bitmap!"); return; } @@ -195,11 +196,12 @@ static void bitmap_set_opaque(void *bitmap, bool opaque) struct bitmap *bm = bitmap; if (bitmap == NULL) { - LOG("NULL bitmap!"); + NSLOG(netsurf, INFO, "NULL bitmap!"); return; } - LOG("setting bitmap %p to %s", bm, opaque ? "opaque" : "transparent"); + NSLOG(netsurf, INFO, "setting bitmap %p to %s", bm, + opaque ? "opaque" : "transparent"); bm->opaque = opaque; } @@ -216,7 +218,7 @@ static bool bitmap_test_opaque(void *bitmap) struct bitmap *bm = bitmap; if (bitmap == NULL) { - LOG("NULL bitmap!"); + NSLOG(netsurf, INFO, "NULL bitmap!"); return false; } @@ -224,11 +226,11 @@ static bool bitmap_test_opaque(void *bitmap) while (tst-- > 0) { if (bm->pixdata[(tst << 2) + 3] != 0xff) { - LOG("bitmap %p has transparency", bm); + NSLOG(netsurf, INFO, "bitmap %p has transparency", bm); return false; } } - LOG("bitmap %p is opaque", bm); + NSLOG(netsurf, INFO, "bitmap %p is opaque", bm); return true; } @@ -243,7 +245,7 @@ static bool bitmap_get_opaque(void *bitmap) struct bitmap *bm = bitmap; if (bitmap == NULL) { - LOG("NULL bitmap!"); + NSLOG(netsurf, INFO, "NULL bitmap!"); return false; } @@ -255,7 +257,7 @@ static int bitmap_get_width(void *bitmap) struct bitmap *bm = bitmap; if (bitmap == NULL) { - LOG("NULL bitmap!"); + NSLOG(netsurf, INFO, "NULL bitmap!"); return 0; } @@ -267,7 +269,7 @@ static int bitmap_get_height(void *bitmap) struct bitmap *bm = bitmap; if (bitmap == NULL) { - LOG("NULL bitmap!"); + NSLOG(netsurf, INFO, "NULL bitmap!"); return 0; } @@ -328,8 +330,8 @@ bitmap_render(struct bitmap *bitmap, struct hlcache_handle *content) height = ((width * bitmap->height) + (bitmap->width / 2)) / bitmap->width; - LOG("bitmap %p for content %p width %d, height %d", - bitmap, content, width, height); + NSLOG(netsurf, INFO, "bitmap %p for content %p width %d, height %d", + bitmap, content, width, height); /* create two memory device contexts to put the bitmaps in */ bufferdc = CreateCompatibleDC(NULL); diff --git a/frontends/windows/corewindow.c b/frontends/windows/corewindow.c index 3c31c5e46..7d88ce7c4 100644 --- a/frontends/windows/corewindow.c +++ b/frontends/windows/corewindow.c @@ -155,7 +155,7 @@ nsw32_corewindow_vscroll(struct nsw32_corewindow *nsw32_cw, SCROLLINFO si; /* current scroll information */ SCROLLINFO usi; /* updated scroll infomation for scrollwindowex */ - LOG("VSCROLL"); + NSLOG(netsurf, INFO, "VSCROLL"); si.cbSize = sizeof(si); si.fMask = SIF_ALL; @@ -230,7 +230,7 @@ nsw32_corewindow_hscroll(struct nsw32_corewindow *nsw32_cw, SCROLLINFO si; /* current scroll information */ SCROLLINFO usi; /* updated scroll infomation for scrollwindowex */ - LOG("VSCROLL"); + NSLOG(netsurf, INFO, "VSCROLL"); si.cbSize = sizeof(si); si.fMask = SIF_ALL; @@ -450,7 +450,7 @@ nsw32_cw_update_size(struct core_window *cw, int width, int height) nsw32_cw->content_width = width; nsw32_cw->content_height = height; - LOG("new content size w:%d h:%d", width, height); + NSLOG(netsurf, INFO, "new content size w:%d h:%d", width, height); update_scrollbars(nsw32_cw); } @@ -527,7 +527,7 @@ nsw32_corewindow_init(HINSTANCE hInstance, CS_DBLCLKS; } - LOG("creating hInstance %p core window", hInstance); + NSLOG(netsurf, INFO, "creating hInstance %p core window", hInstance); nsw32_cw->hWnd = CreateWindowEx(0, windowclassname_corewindow, nsw32_cw->title, @@ -541,7 +541,7 @@ nsw32_corewindow_init(HINSTANCE hInstance, hInstance, NULL); if (nsw32_cw->hWnd == NULL) { - LOG("Window create failed"); + NSLOG(netsurf, INFO, "Window create failed"); return NSERROR_NOMEM; } diff --git a/frontends/windows/download.c b/frontends/windows/download.c index 3a969834e..dfcd2b5a4 100644 --- a/frontends/windows/download.c +++ b/frontends/windows/download.c @@ -253,7 +253,8 @@ gui_download_window_create(download_context *ctx, struct gui_window *gui) strcat(destination, "/"); if (strlen(destination) + strlen(filename) < PATH_MAX - 1) strcat(destination, filename); - LOG("download %s [%s] from %s to %s", filename, size, domain, destination); + NSLOG(netsurf, INFO, "download %s [%s] from %s to %s", filename, + size, domain, destination); w->title = filename; w->domain = domain; w->size = total_size; @@ -313,7 +314,8 @@ gui_download_window_data(struct gui_download_window *w, const char *data, struct timeval val; res = fwrite((void *)data, 1, size, w->file); if (res != size) - LOG("file write error %d of %d", size - res, size); + NSLOG(netsurf, INFO, "file write error %d of %d", size - res, + size); w->downloaded += res; w->progress = (unsigned int)(((long long)(w->downloaded) * 10000) / w->size); @@ -327,7 +329,7 @@ gui_download_window_data(struct gui_download_window *w, const char *data, static void gui_download_window_error(struct gui_download_window *w, const char *error_msg) { - LOG("error %s", error_msg); + NSLOG(netsurf, INFO, "error %s", error_msg); } static void gui_download_window_done(struct gui_download_window *w) diff --git a/frontends/windows/drawable.c b/frontends/windows/drawable.c index 28a76cfe8..f491e0a2a 100644 --- a/frontends/windows/drawable.c +++ b/frontends/windows/drawable.c @@ -83,7 +83,7 @@ nsws_drawable_vscroll(struct gui_window *gw, HWND hwnd, WPARAM wparam) SCROLLINFO si; int mem; - LOG("VSCROLL %d", gw->requestscrolly); + NSLOG(netsurf, INFO, "VSCROLL %d", gw->requestscrolly); if (gw->requestscrolly != 0) return 0; @@ -157,7 +157,7 @@ nsws_drawable_hscroll(struct gui_window *gw, HWND hwnd, WPARAM wparam) SCROLLINFO si; int mem; - LOG("HSCROLL %d", gw->requestscrollx); + NSLOG(netsurf, INFO, "HSCROLL %d", gw->requestscrollx); if (gw->requestscrollx != 0) return 0; @@ -369,7 +369,8 @@ nsws_drawable_mouseup(struct gui_window *gw, (gw->bw == NULL)) return 0; - LOG("state 0x%x, press 0x%x", gw->mouse->state, press); + NSLOG(netsurf, INFO, "state 0x%x, press 0x%x", gw->mouse->state, + press); if ((gw->mouse->state & press) != 0) { gw->mouse->state &= ~press; gw->mouse->state |= click; @@ -383,10 +384,10 @@ nsws_drawable_mouseup(struct gui_window *gw, gw->mouse->state &= ~BROWSER_MOUSE_MOD_3; if ((gw->mouse->state & click) != 0) { - LOG("mouse click bw %p, state 0x%x, x %f, y %f", - gw->bw, gw->mouse->state, - (x + gw->scrollx) / gw->scale, - (y + gw->scrolly) / gw->scale); + NSLOG(netsurf, INFO, + "mouse click bw %p, state 0x%x, x %f, y %f", gw->bw, + gw->mouse->state, (x + gw->scrollx) / gw->scale, + (y + gw->scrolly) / gw->scale); browser_window_mouse_click(gw->bw, gw->mouse->state, @@ -430,10 +431,9 @@ nsws_drawable_mousedown(struct gui_window *gw, gw->mouse->pressed_x = (x + gw->scrollx) / gw->scale; gw->mouse->pressed_y = (y + gw->scrolly) / gw->scale; - LOG("mouse click bw %p, state %x, x %f, y %f", - gw->bw, gw->mouse->state, - (x + gw->scrollx) / gw->scale, - (y + gw->scrolly) / gw->scale); + NSLOG(netsurf, INFO, "mouse click bw %p, state %x, x %f, y %f", + gw->bw, gw->mouse->state, (x + gw->scrollx) / gw->scale, + (y + gw->scrolly) / gw->scale); browser_window_mouse_click(gw->bw, gw->mouse->state, (x + gw->scrollx) / gw->scale, @@ -466,7 +466,8 @@ nsws_drawable_mousemove(struct gui_window *gw, int x, int y) (abs(x - gw->mouse->pressed_x) >= 5) && (abs(y - gw->mouse->pressed_y) >= 5)) { - LOG("Drag start state 0x%x", gw->mouse->state); + NSLOG(netsurf, INFO, "Drag start state 0x%x", + gw->mouse->state); if ((gw->mouse->state & BROWSER_MOUSE_PRESS_1) != 0) { browser_window_mouse_click(gw->bw, BROWSER_MOUSE_DRAG_1, @@ -515,7 +516,8 @@ nsws_window_drawable_event_callback(HWND hwnd, gw = nsws_get_gui_window(hwnd); if (gw == NULL) { - LOG("Unable to find gui window structure for hwnd %p", hwnd); + NSLOG(netsurf, INFO, + "Unable to find gui window structure for hwnd %p", hwnd); return DefWindowProc(hwnd, msg, wparam, lparam); } @@ -604,7 +606,7 @@ nsws_window_create_drawable(HINSTANCE hinstance, if (hwnd == NULL) { win_perror("WindowCreateDrawable"); - LOG("Window creation failed"); + NSLOG(netsurf, INFO, "Window creation failed"); return NULL; } diff --git a/frontends/windows/filetype.c b/frontends/windows/filetype.c index d31434aeb..a5fd9e95e 100644 --- a/frontends/windows/filetype.c +++ b/frontends/windows/filetype.c @@ -39,7 +39,7 @@ static const char *fetch_filetype(const char *unix_path) { int l; - LOG("unix path %s", unix_path); + NSLOG(netsurf, INFO, "unix path %s", unix_path); l = strlen(unix_path); if (2 < l && strcasecmp(unix_path + l - 3, "css") == 0) return "text/css"; diff --git a/frontends/windows/findfile.c b/frontends/windows/findfile.c index e1c9595eb..e665530ba 100644 --- a/frontends/windows/findfile.c +++ b/frontends/windows/findfile.c @@ -99,7 +99,7 @@ char *nsws_find_resource(char *buf, const char *filename, const char *def) char t[PATH_MAX]; if (cdir != NULL) { - LOG("Found Home %s", cdir); + NSLOG(netsurf, INFO, "Found Home %s", cdir); strcpy(t, cdir); strcat(t, "/.netsurf/"); strcat(t, filename); @@ -126,7 +126,7 @@ char *nsws_find_resource(char *buf, const char *filename, const char *def) getcwd(t, PATH_MAX - SLEN("\\res\\") - strlen(filename)); strcat(t, "\\res\\"); strcat(t, filename); - LOG("looking in %s", t); + NSLOG(netsurf, INFO, "looking in %s", t); if ((realpath(t, buf) != NULL) && (access(buf, R_OK) == 0)) return buf; diff --git a/frontends/windows/gui.c b/frontends/windows/gui.c index 602dcd445..890bfae42 100644 --- a/frontends/windows/gui.c +++ b/frontends/windows/gui.c @@ -66,7 +66,7 @@ void win32_run(void) int timeout; /* timeout in miliseconds */ UINT timer_id = 0; - LOG("Starting messgae dispatcher"); + NSLOG(netsurf, INFO, "Starting messgae dispatcher"); while (!win32_quit) { /* run the scheduler and discover how long to wait for @@ -128,7 +128,7 @@ static void gui_get_clipboard(char **buffer, size_t *length) clipboard_handle = GetClipboardData(CF_TEXT); if (clipboard_handle != NULL) { content = GlobalLock(clipboard_handle); - LOG("pasting %s", content); + NSLOG(netsurf, INFO, "pasting %s", content); GlobalUnlock(clipboard_handle); } } diff --git a/frontends/windows/main.c b/frontends/windows/main.c index d019f10c7..98e90be80 100644 --- a/frontends/windows/main.c +++ b/frontends/windows/main.c @@ -99,7 +99,7 @@ static nserror get_config_home(char **config_home_out) *config_home_out = strdup(adPath); - LOG("using config path \"%s\"", *config_home_out); + NSLOG(netsurf, INFO, "using config path \"%s\"", *config_home_out); return NSERROR_OK; } @@ -343,15 +343,16 @@ WinMain(HINSTANCE hInstance, HINSTANCE hLastInstance, LPSTR lpcli, int ncmd) /* Locate the correct user configuration directory path */ ret = get_config_home(&nsw32_config_home); if (ret != NSERROR_OK) { - LOG("Unable to locate a configuration directory."); + NSLOG(netsurf, INFO, + "Unable to locate a configuration directory."); nsw32_config_home = NULL; } /* Initialise user options */ ret = nsw32_option_init(&argc, argv); if (ret != NSERROR_OK) { - LOG("Options failed to initialise (%s)\n", - messages_get_errorcode(ret)); + NSLOG(netsurf, INFO, "Options failed to initialise (%s)\n", + messages_get_errorcode(ret)); return 1; } @@ -365,7 +366,7 @@ WinMain(HINSTANCE hInstance, HINSTANCE hLastInstance, LPSTR lpcli, int ncmd) /* common initialisation */ ret = netsurf_init(NULL); if (ret != NSERROR_OK) { - LOG("NetSurf failed to initialise"); + NSLOG(netsurf, INFO, "NetSurf failed to initialise"); return 1; } @@ -392,7 +393,7 @@ WinMain(HINSTANCE hInstance, HINSTANCE hLastInstance, LPSTR lpcli, int ncmd) addr = NETSURF_HOMEPAGE; } - LOG("calling browser_window_create"); + NSLOG(netsurf, INFO, "calling browser_window_create"); ret = nsurl_create(addr, &url); if (ret == NSERROR_OK) { diff --git a/frontends/windows/plot.c b/frontends/windows/plot.c index 1bd0ba4a0..f38fe7522 100644 --- a/frontends/windows/plot.c +++ b/frontends/windows/plot.c @@ -84,7 +84,7 @@ plot_block(COLORREF col, int x, int y, int width, int height) /* ensure the plot HDC is set */ if (plot_hdc == NULL) { - LOG("HDC not set on call to plotters"); + NSLOG(netsurf, INFO, "HDC not set on call to plotters"); return NSERROR_INVALID; } @@ -299,7 +299,7 @@ plot_bitmap(struct bitmap *bitmap, int x, int y, int width, int height) /* ensure the plot HDC is set */ if (plot_hdc == NULL) { - LOG("HDC not set on call to plotters"); + NSLOG(netsurf, INFO, "HDC not set on call to plotters"); return NSERROR_INVALID; } @@ -404,7 +404,7 @@ arc(const struct redraw_context *ctx, /* ensure the plot HDC is set */ if (plot_hdc == NULL) { - LOG("HDC not set on call to plotters"); + NSLOG(netsurf, INFO, "HDC not set on call to plotters"); return NSERROR_INVALID; } @@ -515,7 +515,7 @@ disc(const struct redraw_context *ctx, /* ensure the plot HDC is set */ if (plot_hdc == NULL) { - LOG("HDC not set on call to plotters"); + NSLOG(netsurf, INFO, "HDC not set on call to plotters"); return NSERROR_INVALID; } @@ -594,7 +594,7 @@ line(const struct redraw_context *ctx, /* ensure the plot HDC is set */ if (plot_hdc == NULL) { - LOG("HDC not set on call to plotters"); + NSLOG(netsurf, INFO, "HDC not set on call to plotters"); return NSERROR_INVALID; } @@ -661,7 +661,7 @@ rectangle(const struct redraw_context *ctx, /* ensure the plot HDC is set */ if (plot_hdc == NULL) { - LOG("HDC not set on call to plotters"); + NSLOG(netsurf, INFO, "HDC not set on call to plotters"); return NSERROR_INVALID; } @@ -744,7 +744,7 @@ polygon(const struct redraw_context *ctx, /* ensure the plot HDC is set */ if (plot_hdc == NULL) { - LOG("HDC not set on call to plotters"); + NSLOG(netsurf, INFO, "HDC not set on call to plotters"); return NSERROR_INVALID; } @@ -878,7 +878,7 @@ bitmap(const struct redraw_context *ctx, PLOT_LOG("Plotting %p at %d,%d by %d,%d",bitmap, x,y,width,height); if (bitmap == NULL) { - LOG("Passed null bitmap!"); + NSLOG(netsurf, INFO, "Passed null bitmap!"); return NSERROR_OK; } @@ -993,7 +993,7 @@ text(const struct redraw_context *ctx, /* ensure the plot HDC is set */ if (plot_hdc == NULL) { - LOG("HDC not set on call to plotters"); + NSLOG(netsurf, INFO, "HDC not set on call to plotters"); return NSERROR_INVALID; } diff --git a/frontends/windows/prefs.c b/frontends/windows/prefs.c index f84ee1c96..591b57426 100644 --- a/frontends/windows/prefs.c +++ b/frontends/windows/prefs.c @@ -304,7 +304,8 @@ static BOOL CALLBACK options_appearance_dialog_handler(HWND hwnd, case WM_COMMAND: - LOG("WM_COMMAND Identifier 0x%x",LOWORD(wparam)); + NSLOG(netsurf, INFO, "WM_COMMAND Identifier 0x%x", + LOWORD(wparam)); switch(LOWORD(wparam)) { case IDC_PREFS_PROXYTYPE: diff --git a/frontends/windows/schedule.c b/frontends/windows/schedule.c index eae6c1d63..d6a757246 100644 --- a/frontends/windows/schedule.c +++ b/frontends/windows/schedule.c @@ -216,12 +216,14 @@ void list_schedule(void) gettimeofday(&tv, NULL); - LOG("schedule list at %ld:%ld", tv.tv_sec, tv.tv_usec); + NSLOG(netsurf, INFO, "schedule list at %ld:%ld", tv.tv_sec, + tv.tv_usec); cur_nscb = schedule_list; while (cur_nscb != NULL) { - LOG("Schedule %p at %ld:%ld", cur_nscb, cur_nscb->tv.tv_sec, cur_nscb->tv.tv_usec); + NSLOG(netsurf, INFO, "Schedule %p at %ld:%ld", cur_nscb, + cur_nscb->tv.tv_sec, cur_nscb->tv.tv_usec); cur_nscb = cur_nscb->next; } } diff --git a/frontends/windows/ssl_cert.c b/frontends/windows/ssl_cert.c index fac211c11..4db061626 100644 --- a/frontends/windows/ssl_cert.c +++ b/frontends/windows/ssl_cert.c @@ -191,7 +191,7 @@ nserror nsw32_cert_verify(struct nsurl *url, return res; } - LOG("creating hInstance %p SSL window", hinst); + NSLOG(netsurf, INFO, "creating hInstance %p SSL window", hinst); ncwin->hWnd = CreateWindowEx(0, windowclassname_sslcert, "SSL Certificate viewer", @@ -208,7 +208,7 @@ nserror nsw32_cert_verify(struct nsurl *url, hinst, NULL); if (ncwin->hWnd == NULL) { - LOG("Window create failed"); + NSLOG(netsurf, INFO, "Window create failed"); return NSERROR_NOMEM; } @@ -375,8 +375,11 @@ nsw32_window_ssl_cert_command(HWND hwnd, int identifier, HWND ctrl_window) { - LOG("notification_code %x identifier %x ctrl_window %p", - notification_code, identifier, ctrl_window); + NSLOG(netsurf, INFO, + "notification_code %x identifier %x ctrl_window %p", + notification_code, + identifier, + ctrl_window); switch(identifier) { case IDC_SSLCERT_BTN_ACCEPT: diff --git a/frontends/windows/window.c b/frontends/windows/window.c index c72173697..20db25a56 100644 --- a/frontends/windows/window.c +++ b/frontends/windows/window.c @@ -88,7 +88,7 @@ static int get_window_dpi(HWND hwnd) ReleaseDC(hwnd, hdc); - LOG("FIX DPI %d", dpi); + NSLOG(netsurf, INFO, "FIX DPI %d", dpi); return dpi; } @@ -163,7 +163,8 @@ static HWND nsws_window_create(HINSTANCE hInstance, struct gui_window *gw) gw->mainmenu = LoadMenu(hInstance, MAKEINTRESOURCE(IDR_MENU_MAIN)); gw->rclick = LoadMenu(hInstance, MAKEINTRESOURCE(IDR_MENU_CONTEXT)); - LOG("creating hInstance %p GUI window %p", hInstance, gw); + NSLOG(netsurf, INFO, "creating hInstance %p GUI window %p", + hInstance, gw); hwnd = CreateWindowEx(0, windowclassname_main, "NetSurf Browser", @@ -181,7 +182,7 @@ static HWND nsws_window_create(HINSTANCE hInstance, struct gui_window *gw) NULL); if (hwnd == NULL) { - LOG("Window create failed"); + NSLOG(netsurf, INFO, "Window create failed"); return NULL; } @@ -194,9 +195,9 @@ static HWND nsws_window_create(HINSTANCE hInstance, struct gui_window *gw) (nsoption_int(window_height) >= 100) && (nsoption_int(window_x) >= 0) && (nsoption_int(window_y) >= 0)) { - LOG("Setting Window position %d,%d %d,%d", - nsoption_int(window_x), nsoption_int(window_y), - nsoption_int(window_width), nsoption_int(window_height)); + NSLOG(netsurf, INFO, "Setting Window position %d,%d %d,%d", + nsoption_int(window_x), nsoption_int(window_y), + nsoption_int(window_width), nsoption_int(window_height)); SetWindowPos(hwnd, HWND_TOP, nsoption_int(window_x), nsoption_int(window_y), @@ -227,47 +228,50 @@ nsws_window_toolbar_command(struct gui_window *gw, int identifier, HWND ctrl_window) { - LOG("notification_code %d identifier %d ctrl_window %p", - notification_code, identifier, ctrl_window); + NSLOG(netsurf, INFO, + "notification_code %d identifier %d ctrl_window %p", + notification_code, + identifier, + ctrl_window); switch(identifier) { case IDC_MAIN_URLBAR: switch (notification_code) { case EN_CHANGE: - LOG("EN_CHANGE"); + NSLOG(netsurf, INFO, "EN_CHANGE"); break; case EN_ERRSPACE: - LOG("EN_ERRSPACE"); + NSLOG(netsurf, INFO, "EN_ERRSPACE"); break; case EN_HSCROLL: - LOG("EN_HSCROLL"); + NSLOG(netsurf, INFO, "EN_HSCROLL"); break; case EN_KILLFOCUS: - LOG("EN_KILLFOCUS"); + NSLOG(netsurf, INFO, "EN_KILLFOCUS"); break; case EN_MAXTEXT: - LOG("EN_MAXTEXT"); + NSLOG(netsurf, INFO, "EN_MAXTEXT"); break; case EN_SETFOCUS: - LOG("EN_SETFOCUS"); + NSLOG(netsurf, INFO, "EN_SETFOCUS"); break; case EN_UPDATE: - LOG("EN_UPDATE"); + NSLOG(netsurf, INFO, "EN_UPDATE"); break; case EN_VSCROLL: - LOG("EN_VSCROLL"); + NSLOG(netsurf, INFO, "EN_VSCROLL"); break; default: - LOG("Unknown notification_code"); + NSLOG(netsurf, INFO, "Unknown notification_code"); break; } break; @@ -421,7 +425,7 @@ nsws_window_urlbar_callback(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) case WM_DESTROY: hFont = (HFONT)SendMessage(hwnd, WM_GETFONT, 0, 0); if (hFont != NULL) { - LOG("Destroyed font object"); + NSLOG(netsurf, INFO, "Destroyed font object"); DeleteObject(hFont); } @@ -502,12 +506,13 @@ nsws_window_urlbar_create(HINSTANCE hInstance, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH | FF_SWISS, "Arial"); if (hFont != NULL) { - LOG("Setting font object"); + NSLOG(netsurf, INFO, "Setting font object"); SendMessage(hwnd, WM_SETFONT, (WPARAM)hFont, 0); } - LOG("Created url bar hwnd:%p, x:%d, y:%d, w:%d, h:%d", - hwnd, urlx, urly, urlwidth, urlheight); + NSLOG(netsurf, INFO, + "Created url bar hwnd:%p, x:%d, y:%d, w:%d, h:%d", hwnd, urlx, + urly, urlwidth, urlheight); return hwnd; } @@ -548,7 +553,7 @@ nsws_window_throbber_create(HINSTANCE hInstance, NULL); nsws_find_resource(avi, "throbber.avi", "windows/res/throbber.avi"); - LOG("setting throbber avi as %s", avi); + NSLOG(netsurf, INFO, "setting throbber avi as %s", avi); Animate_Open(hwnd, avi); if (gw->throbbing) { Animate_Play(hwnd, 0, -1, -1); @@ -576,7 +581,8 @@ get_imagelist(HINSTANCE hInstance, int resid, int bsize, int bcnt) HIMAGELIST hImageList; HBITMAP hScrBM; - LOG("resource id %d, bzize %d, bcnt %d", resid, bsize, bcnt); + NSLOG(netsurf, INFO, "resource id %d, bzize %d, bcnt %d", resid, + bsize, bcnt); hImageList = ImageList_Create(bsize, bsize, ILC_COLOR24 | ILC_MASK, 0, @@ -997,8 +1003,11 @@ nsws_window_command(HWND hwnd, { nserror ret; - LOG("notification_code %x identifier %x ctrl_window %p", - notification_code, identifier, ctrl_window); + NSLOG(netsurf, INFO, + "notification_code %x identifier %x ctrl_window %p", + notification_code, + identifier, + ctrl_window); switch(identifier) { @@ -1073,7 +1082,7 @@ nsws_window_command(HWND hwnd, HANDLE h = GetClipboardData(CF_TEXT); if (h != NULL) { char *content = GlobalLock(h); - LOG("pasting %s\n", content); + NSLOG(netsurf, INFO, "pasting %s\n", content); GlobalUnlock(h); } CloseClipboard(); @@ -1276,7 +1285,7 @@ nsws_window_command(HWND hwnd, int len = SendMessage(gw->urlbar, WM_GETTEXTLENGTH, 0, 0); char addr[len + 1]; SendMessage(gw->urlbar, WM_GETTEXT, (WPARAM)(len + 1), (LPARAM)addr); - LOG("launching %s\n", addr); + NSLOG(netsurf, INFO, "launching %s\n", addr); if (nsurl_create(addr, &url) != NSERROR_OK) { win32_warning("NoMemory", 0); @@ -1313,7 +1322,7 @@ nsws_window_command(HWND hwnd, */ static bool win32_window_get_scroll(struct gui_window *gw, int *sx, int *sy) { - LOG("get scroll"); + NSLOG(netsurf, INFO, "get scroll"); if (gw == NULL) return false; @@ -1410,7 +1419,8 @@ nsws_window_event_callback(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) gw = nsws_get_gui_window(hwnd); if (gw == NULL) { - LOG("Unable to find gui window structure for hwnd %p", hwnd); + NSLOG(netsurf, INFO, + "Unable to find gui window structure for hwnd %p", hwnd); return DefWindowProc(hwnd, msg, wparam, lparam); } @@ -1463,7 +1473,7 @@ win32_window_create(struct browser_window *bw, { struct gui_window *gw; - LOG("Creating gui window for browser window %p", bw); + NSLOG(netsurf, INFO, "Creating gui window for browser window %p", bw); gw = calloc(1, sizeof(struct gui_window)); if (gw == NULL) { @@ -1484,7 +1494,7 @@ win32_window_create(struct browser_window *bw, gw->mouse = malloc(sizeof(struct browser_mouse)); if (gw->mouse == NULL) { free(gw); - LOG("Unable to allocate mouse state"); + NSLOG(netsurf, INFO, "Unable to allocate mouse state"); return NULL; } gw->mouse->gui = gw; @@ -1504,8 +1514,12 @@ win32_window_create(struct browser_window *bw, gw->statusbar = nsws_window_create_statusbar(hinst, gw->main, gw); gw->drawingarea = nsws_window_create_drawable(hinst, gw->main, gw); - LOG("new window: main:%p toolbar:%p statusbar %p drawingarea %p", - gw->main, gw->toolbar, gw->statusbar, gw->drawingarea); + NSLOG(netsurf, INFO, + "new window: main:%p toolbar:%p statusbar %p drawingarea %p", + gw->main, + gw->toolbar, + gw->statusbar, + gw->drawingarea); font_hwnd = gw->drawingarea; open_windows++; @@ -1556,7 +1570,7 @@ win32_window_get_dimensions(struct gui_window *gw, *width = gw->width; *height = gw->height; - LOG("gw:%p w=%d h=%d", gw, *width, *height); + NSLOG(netsurf, INFO, "gw:%p w=%d h=%d", gw, *width, *height); return NSERROR_OK; } @@ -1588,7 +1602,7 @@ static void win32_window_set_title(struct gui_window *w, const char *title) return; } - LOG("%p, title %s", w, title); + NSLOG(netsurf, INFO, "%p, title %s", w, title); fulltitle = malloc(strlen(title) + SLEN(" - NetSurf") + 1); if (fulltitle == NULL) { win32_warning("NoMemory", 0); -- cgit v1.2.3