mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-12-18 18:23:25 +03:00
fixup all the remaining logging macro callsites
The semantic patch tool appears to have missed some difficult to reason about callsites which have now been manually cleaned up
This commit is contained in:
parent
30c2962faa
commit
0d811963c1
@ -3710,7 +3710,7 @@ HOOKF(void, ami_scroller_hook, Object *, object, struct IntuiMessage *)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
LOG(("IDCMP hook unhandled event: %d\n", msg->Class));
|
LOG("IDCMP hook unhandled event: %d\n", msg->Class);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// ReplyMsg((struct Message *)msg);
|
// ReplyMsg((struct Message *)msg);
|
||||||
|
18
amiga/libs.c
18
amiga/libs.c
@ -54,14 +54,14 @@
|
|||||||
|
|
||||||
#ifdef __amigaos4__
|
#ifdef __amigaos4__
|
||||||
#define AMINS_LIB_OPEN(LIB, LIBVER, PREFIX, INTERFACE, INTVER, FAIL) \
|
#define AMINS_LIB_OPEN(LIB, LIBVER, PREFIX, INTERFACE, INTVER, FAIL) \
|
||||||
LOG(("Opening %s v%d", LIB, LIBVER)); \
|
LOG("Opening %s v%d", LIB, LIBVER); \
|
||||||
if((PREFIX##Base = (struct PREFIX##Base *)OpenLibrary(LIB, LIBVER))) { \
|
if((PREFIX##Base = (struct PREFIX##Base *)OpenLibrary(LIB, LIBVER))) { \
|
||||||
I##PREFIX = (struct PREFIX##IFace *)GetInterface((struct Library *)PREFIX##Base, INTERFACE, INTVER, NULL); \
|
I##PREFIX = (struct PREFIX##IFace *)GetInterface((struct Library *)PREFIX##Base, INTERFACE, INTVER, NULL); \
|
||||||
if(I##PREFIX == NULL) { \
|
if(I##PREFIX == NULL) { \
|
||||||
LOG(("Failed to get %s interface v%d of %s", INTERFACE, INTVER, LIB)); \
|
LOG("Failed to get %s interface v%d of %s", INTERFACE, INTVER, LIB); \
|
||||||
} \
|
} \
|
||||||
} else { \
|
} else { \
|
||||||
LOG(("Failed to open %s v%d", LIB, LIBVER)); \
|
LOG("Failed to open %s v%d", LIB, LIBVER); \
|
||||||
if(FAIL == true) { \
|
if(FAIL == true) { \
|
||||||
STRPTR error = ASPrintf("Unable to open %s v%d (fatal error)", LIB, LIBVER); \
|
STRPTR error = ASPrintf("Unable to open %s v%d (fatal error)", LIB, LIBVER); \
|
||||||
ami_misc_fatal_error(error); \
|
ami_misc_fatal_error(error); \
|
||||||
@ -79,13 +79,13 @@
|
|||||||
struct PREFIX##IFace *I##PREFIX;
|
struct PREFIX##IFace *I##PREFIX;
|
||||||
|
|
||||||
#define AMINS_CLASS_OPEN(CLASS, CLASSVER, PREFIX, CLASSGET, NEEDINTERFACE) \
|
#define AMINS_CLASS_OPEN(CLASS, CLASSVER, PREFIX, CLASSGET, NEEDINTERFACE) \
|
||||||
LOG(("Opening %s v%d", CLASS, CLASSVER)); \
|
LOG("Opening %s v%d", CLASS, CLASSVER); \
|
||||||
if((PREFIX##Base = OpenClass(CLASS, CLASSVER, &PREFIX##Class))) { \
|
if((PREFIX##Base = OpenClass(CLASS, CLASSVER, &PREFIX##Class))) { \
|
||||||
if(NEEDINTERFACE == true) { \
|
if(NEEDINTERFACE == true) { \
|
||||||
LOG((" + interface")); \
|
LOG(" + interface"); \
|
||||||
I##PREFIX = (struct PREFIX##IFace *)GetInterface((struct Library *)PREFIX##Base, "main", 1, NULL); \
|
I##PREFIX = (struct PREFIX##IFace *)GetInterface((struct Library *)PREFIX##Base, "main", 1, NULL); \
|
||||||
if(I##PREFIX == NULL) { \
|
if(I##PREFIX == NULL) { \
|
||||||
LOG(("Failed to get main interface v1 of %s", CLASS)); \
|
LOG("Failed to get main interface v1 of %s", CLASS); \
|
||||||
} \
|
} \
|
||||||
} \
|
} \
|
||||||
} \
|
} \
|
||||||
@ -107,10 +107,10 @@
|
|||||||
|
|
||||||
#else
|
#else
|
||||||
#define AMINS_LIB_OPEN(LIB, LIBVER, PREFIX, INTERFACE, INTVER, FAIL) \
|
#define AMINS_LIB_OPEN(LIB, LIBVER, PREFIX, INTERFACE, INTVER, FAIL) \
|
||||||
LOG(("Opening %s v%d", LIB, LIBVER)); \
|
LOG("Opening %s v%d", LIB, LIBVER); \
|
||||||
if((PREFIX##Base = (struct PREFIX##Base *)OpenLibrary(LIB, LIBVER))) { \
|
if((PREFIX##Base = (struct PREFIX##Base *)OpenLibrary(LIB, LIBVER))) { \
|
||||||
} else { \
|
} else { \
|
||||||
LOG(("Failed to open %s v%d", LIB, LIBVER)); \
|
LOG("Failed to open %s v%d", LIB, LIBVER); \
|
||||||
if(FAIL == true) { \
|
if(FAIL == true) { \
|
||||||
STRPTR error = ASPrintf("Unable to open %s v%d (fatal error)", LIB, LIBVER); \
|
STRPTR error = ASPrintf("Unable to open %s v%d (fatal error)", LIB, LIBVER); \
|
||||||
ami_misc_fatal_error(error); \
|
ami_misc_fatal_error(error); \
|
||||||
@ -126,7 +126,7 @@
|
|||||||
struct PREFIX##Base *PREFIX##Base;
|
struct PREFIX##Base *PREFIX##Base;
|
||||||
|
|
||||||
#define AMINS_CLASS_OPEN(CLASS, CLASSVER, PREFIX, CLASSGET, NEEDINTERFACE) \
|
#define AMINS_CLASS_OPEN(CLASS, CLASSVER, PREFIX, CLASSGET, NEEDINTERFACE) \
|
||||||
LOG(("Opening %s v%d", CLASS, CLASSVER)); \
|
LOG("Opening %s v%d", CLASS, CLASSVER); \
|
||||||
if((PREFIX##Base = OpenLibrary(CLASS, CLASSVER))) { \
|
if((PREFIX##Base = OpenLibrary(CLASS, CLASSVER))) { \
|
||||||
PREFIX##Class = CLASSGET##_GetClass(); \
|
PREFIX##Class = CLASSGET##_GetClass(); \
|
||||||
} \
|
} \
|
||||||
|
@ -178,7 +178,7 @@ static void __CDECL menu_about(short item, short title, void *data)
|
|||||||
nserror error;
|
nserror error;
|
||||||
char buf[PATH_MAX];
|
char buf[PATH_MAX];
|
||||||
|
|
||||||
LOG(("%s", __FUNCTION__));
|
LOG("%s", __FUNCTION__);
|
||||||
strcpy((char*)&buf, "file://");
|
strcpy((char*)&buf, "file://");
|
||||||
strncat((char*)&buf, (char*)"./doc/README.TXT",
|
strncat((char*)&buf, (char*)"./doc/README.TXT",
|
||||||
PATH_MAX - (strlen("file://")+1) );
|
PATH_MAX - (strlen("file://")+1) );
|
||||||
@ -205,7 +205,7 @@ static void __CDECL menu_new_win(short item, short title, void *data)
|
|||||||
nserror error;
|
nserror error;
|
||||||
const char *addr;
|
const char *addr;
|
||||||
|
|
||||||
LOG(("%s", __FUNCTION__));
|
LOG("%s", __FUNCTION__);
|
||||||
|
|
||||||
if (nsoption_charp(homepage_url) != NULL) {
|
if (nsoption_charp(homepage_url) != NULL) {
|
||||||
addr = nsoption_charp(homepage_url);
|
addr = nsoption_charp(homepage_url);
|
||||||
@ -233,7 +233,7 @@ static void __CDECL menu_open_url(short item, short title, void *data)
|
|||||||
{
|
{
|
||||||
struct gui_window * gw;
|
struct gui_window * gw;
|
||||||
struct browser_window * bw ;
|
struct browser_window * bw ;
|
||||||
LOG(("%s", __FUNCTION__));
|
LOG("%s", __FUNCTION__);
|
||||||
|
|
||||||
gw = input_window;
|
gw = input_window;
|
||||||
if( gw == NULL ) {
|
if( gw == NULL ) {
|
||||||
@ -248,7 +248,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)
|
static void __CDECL menu_open_file(short item, short title, void *data)
|
||||||
{
|
{
|
||||||
|
|
||||||
LOG(("%s", __FUNCTION__));
|
LOG("%s", __FUNCTION__);
|
||||||
|
|
||||||
const char * filename = file_select(messages_get("OpenFile"), "");
|
const char * filename = file_select(messages_get("OpenFile"), "");
|
||||||
if( filename != NULL ){
|
if( filename != NULL ){
|
||||||
@ -277,7 +277,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)
|
static void __CDECL menu_close_win(short item, short title, void *data)
|
||||||
{
|
{
|
||||||
LOG(("%s", __FUNCTION__));
|
LOG("%s", __FUNCTION__);
|
||||||
if( input_window == NULL )
|
if( input_window == NULL )
|
||||||
return;
|
return;
|
||||||
gui_window_destroy( input_window );
|
gui_window_destroy( input_window );
|
||||||
@ -285,7 +285,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)
|
static void __CDECL menu_save_page(short item, short title, void *data)
|
||||||
{
|
{
|
||||||
LOG(("%s", __FUNCTION__));
|
LOG("%s", __FUNCTION__);
|
||||||
static bool init = true;
|
static bool init = true;
|
||||||
bool is_folder=false;
|
bool is_folder=false;
|
||||||
const char * path;
|
const char * path;
|
||||||
@ -316,7 +316,7 @@ static void __CDECL menu_quit(short item, short title, void *data)
|
|||||||
{
|
{
|
||||||
short buff[8];
|
short buff[8];
|
||||||
memset( &buff, 0, sizeof(short)*8 );
|
memset( &buff, 0, sizeof(short)*8 );
|
||||||
LOG(("%s", __FUNCTION__));
|
LOG("%s", __FUNCTION__);
|
||||||
gemtk_wm_send_msg(NULL, AP_TERM, 0, 0, 0, 0);
|
gemtk_wm_send_msg(NULL, AP_TERM, 0, 0, 0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -328,21 +328,21 @@ static void __CDECL menu_cut(short item, short title, void *data)
|
|||||||
|
|
||||||
static void __CDECL menu_copy(short item, short title, void *data)
|
static void __CDECL menu_copy(short item, short title, void *data)
|
||||||
{
|
{
|
||||||
LOG(("%s", __FUNCTION__));
|
LOG("%s", __FUNCTION__);
|
||||||
if( input_window != NULL )
|
if( input_window != NULL )
|
||||||
browser_window_key_press( input_window->browser->bw, NS_KEY_COPY_SELECTION);
|
browser_window_key_press( input_window->browser->bw, NS_KEY_COPY_SELECTION);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void __CDECL menu_paste(short item, short title, void *data)
|
static void __CDECL menu_paste(short item, short title, void *data)
|
||||||
{
|
{
|
||||||
LOG(("%s", __FUNCTION__));
|
LOG("%s", __FUNCTION__);
|
||||||
if( input_window != NULL )
|
if( input_window != NULL )
|
||||||
browser_window_key_press( input_window->browser->bw, NS_KEY_PASTE);
|
browser_window_key_press( input_window->browser->bw, NS_KEY_PASTE);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void __CDECL menu_find(short item, short title, void *data)
|
static void __CDECL menu_find(short item, short title, void *data)
|
||||||
{
|
{
|
||||||
LOG(("%s", __FUNCTION__));
|
LOG("%s", __FUNCTION__);
|
||||||
if (input_window != NULL) {
|
if (input_window != NULL) {
|
||||||
if (input_window->search) {
|
if (input_window->search) {
|
||||||
window_close_search(input_window->root);
|
window_close_search(input_window->root);
|
||||||
@ -355,13 +355,13 @@ static void __CDECL menu_find(short item, short title, void *data)
|
|||||||
|
|
||||||
static void __CDECL menu_choices(short item, short title, void *data)
|
static void __CDECL menu_choices(short item, short title, void *data)
|
||||||
{
|
{
|
||||||
LOG(("%s", __FUNCTION__));
|
LOG("%s", __FUNCTION__);
|
||||||
open_settings();
|
open_settings();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void __CDECL menu_stop(short item, short title, void *data)
|
static void __CDECL menu_stop(short item, short title, void *data)
|
||||||
{
|
{
|
||||||
LOG(("%s", __FUNCTION__));
|
LOG("%s", __FUNCTION__);
|
||||||
if( input_window == NULL )
|
if( input_window == NULL )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -375,7 +375,7 @@ static void __CDECL menu_reload(short item, short title, void *data)
|
|||||||
if(input_window == NULL)
|
if(input_window == NULL)
|
||||||
return;
|
return;
|
||||||
toolbar_reload_click(input_window->root->toolbar);
|
toolbar_reload_click(input_window->root->toolbar);
|
||||||
LOG(("%s", __FUNCTION__));
|
LOG("%s", __FUNCTION__);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -405,7 +405,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 void __CDECL menu_toolbars(short item, short title, void *data)
|
||||||
{
|
{
|
||||||
static int state = 0;
|
static int state = 0;
|
||||||
LOG(("%s", __FUNCTION__));
|
LOG("%s", __FUNCTION__);
|
||||||
if( input_window != null && input_window->root->toolbar != null ){
|
if( input_window != null && input_window->root->toolbar != null ){
|
||||||
state = !state;
|
state = !state;
|
||||||
// TODO: implement toolbar hide
|
// TODO: implement toolbar hide
|
||||||
@ -415,7 +415,7 @@ static void __CDECL menu_toolbars(short item, short title, void *data)
|
|||||||
|
|
||||||
static void __CDECL menu_savewin(short item, short title, void *data)
|
static void __CDECL menu_savewin(short item, short title, void *data)
|
||||||
{
|
{
|
||||||
LOG(("%s", __FUNCTION__));
|
LOG("%s", __FUNCTION__);
|
||||||
if (input_window && input_window->browser) {
|
if (input_window && input_window->browser) {
|
||||||
GRECT rect;
|
GRECT rect;
|
||||||
wind_get_grect(gemtk_wm_get_handle(input_window->root->win), WF_CURRXYWH,
|
wind_get_grect(gemtk_wm_get_handle(input_window->root->win), WF_CURRXYWH,
|
||||||
@ -435,7 +435,7 @@ static void __CDECL menu_savewin(short item, short title, void *data)
|
|||||||
|
|
||||||
static void __CDECL menu_debug_render(short item, short title, void *data)
|
static void __CDECL menu_debug_render(short item, short title, void *data)
|
||||||
{
|
{
|
||||||
LOG(("%s", __FUNCTION__));
|
LOG("%s", __FUNCTION__);
|
||||||
html_redraw_debug = !html_redraw_debug;
|
html_redraw_debug = !html_redraw_debug;
|
||||||
if( input_window != NULL ) {
|
if( input_window != NULL ) {
|
||||||
if ( input_window->browser != NULL
|
if ( input_window->browser != NULL
|
||||||
@ -466,7 +466,7 @@ static void __CDECL menu_bg_images(short item, short title, void *data)
|
|||||||
|
|
||||||
static void __CDECL menu_back(short item, short title, void *data)
|
static void __CDECL menu_back(short item, short title, void *data)
|
||||||
{
|
{
|
||||||
LOG(("%s", __FUNCTION__));
|
LOG("%s", __FUNCTION__);
|
||||||
if( input_window == NULL )
|
if( input_window == NULL )
|
||||||
return;
|
return;
|
||||||
toolbar_back_click(input_window->root->toolbar);
|
toolbar_back_click(input_window->root->toolbar);
|
||||||
@ -474,7 +474,7 @@ static void __CDECL menu_back(short item, short title, void *data)
|
|||||||
|
|
||||||
static void __CDECL menu_forward(short item, short title, void *data)
|
static void __CDECL menu_forward(short item, short title, void *data)
|
||||||
{
|
{
|
||||||
LOG(("%s", __FUNCTION__));
|
LOG("%s", __FUNCTION__);
|
||||||
if( input_window == NULL )
|
if( input_window == NULL )
|
||||||
return;
|
return;
|
||||||
toolbar_forward_click(input_window->root->toolbar);
|
toolbar_forward_click(input_window->root->toolbar);
|
||||||
@ -482,7 +482,7 @@ static void __CDECL menu_forward(short item, short title, void *data)
|
|||||||
|
|
||||||
static void __CDECL menu_home(short item, short title, void *data)
|
static void __CDECL menu_home(short item, short title, void *data)
|
||||||
{
|
{
|
||||||
LOG(("%s", __FUNCTION__));
|
LOG("%s", __FUNCTION__);
|
||||||
if( input_window == NULL )
|
if( input_window == NULL )
|
||||||
return;
|
return;
|
||||||
toolbar_home_click(input_window->root->toolbar);
|
toolbar_home_click(input_window->root->toolbar);
|
||||||
@ -490,20 +490,20 @@ static void __CDECL menu_home(short item, short title, void *data)
|
|||||||
|
|
||||||
static void __CDECL menu_lhistory(short item, short title, void *data)
|
static void __CDECL menu_lhistory(short item, short title, void *data)
|
||||||
{
|
{
|
||||||
LOG(("%s", __FUNCTION__));
|
LOG("%s", __FUNCTION__);
|
||||||
if( input_window == NULL )
|
if( input_window == NULL )
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void __CDECL menu_ghistory(short item, short title, void *data)
|
static void __CDECL menu_ghistory(short item, short title, void *data)
|
||||||
{
|
{
|
||||||
LOG(("%s", __FUNCTION__));
|
LOG("%s", __FUNCTION__);
|
||||||
atari_global_history_open();
|
atari_global_history_open();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void __CDECL menu_add_bookmark(short item, short title, void *data)
|
static void __CDECL menu_add_bookmark(short item, short title, void *data)
|
||||||
{
|
{
|
||||||
LOG(("%s", __FUNCTION__));
|
LOG("%s", __FUNCTION__);
|
||||||
if (input_window) {
|
if (input_window) {
|
||||||
if( browser_window_has_content(input_window->browser->bw) ){
|
if( browser_window_has_content(input_window->browser->bw) ){
|
||||||
atari_hotlist_add_page(
|
atari_hotlist_add_page(
|
||||||
@ -516,26 +516,26 @@ static void __CDECL menu_add_bookmark(short item, short title, void *data)
|
|||||||
|
|
||||||
static void __CDECL menu_bookmarks(short item, short title, void *data)
|
static void __CDECL menu_bookmarks(short item, short title, void *data)
|
||||||
{
|
{
|
||||||
LOG(("%s", __FUNCTION__));
|
LOG("%s", __FUNCTION__);
|
||||||
atari_hotlist_open();
|
atari_hotlist_open();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void __CDECL menu_cookies(short item, short title, void *data)
|
static void __CDECL menu_cookies(short item, short title, void *data)
|
||||||
{
|
{
|
||||||
LOG(("%s", __FUNCTION__));
|
LOG("%s", __FUNCTION__);
|
||||||
atari_cookie_manager_open();
|
atari_cookie_manager_open();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void __CDECL menu_vlog(short item, short title, void *data)
|
static void __CDECL menu_vlog(short item, short title, void *data)
|
||||||
{
|
{
|
||||||
LOG(("%s", __FUNCTION__));
|
LOG("%s", __FUNCTION__);
|
||||||
verbose_log = !verbose_log;
|
verbose_log = !verbose_log;
|
||||||
menu_icheck(h_gem_menu, MAINMENU_M_VLOG, (verbose_log) ? 1 : 0);
|
menu_icheck(h_gem_menu, MAINMENU_M_VLOG, (verbose_log) ? 1 : 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void __CDECL menu_help_content(short item, short title, void *data)
|
static void __CDECL menu_help_content(short item, short title, void *data)
|
||||||
{
|
{
|
||||||
LOG(("%s", __FUNCTION__));
|
LOG("%s", __FUNCTION__);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -81,7 +81,7 @@ static void __CDECL cert_info_draw( WINDOW * win, short buf[8], void * data)
|
|||||||
if( line == NULL )
|
if( line == NULL )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
LOG(("Cert info draw, win: %p, data: %p, scrollx: %d", win, data, dp->scrollx ));
|
LOG("Cert info draw, win: %p, data: %p, scrollx: %d", win, data, dp->scrollx );
|
||||||
|
|
||||||
WindGet( win, WF_WORKXYWH, &x, &y, &w, &h );
|
WindGet( win, WF_WORKXYWH, &x, &y, &w, &h );
|
||||||
/*using static values here, as RsrcUserDraw has mem leaks & a very small stack */
|
/*using static values here, as RsrcUserDraw has mem leaks & a very small stack */
|
||||||
|
@ -161,7 +161,7 @@ static bool fetch_rsrc_process(struct fetch_rsrc_context *c)
|
|||||||
* rsrc://[TYPE][@NUM]/name[,mime]
|
* rsrc://[TYPE][@NUM]/name[,mime]
|
||||||
*/
|
*/
|
||||||
|
|
||||||
LOG(("*** Processing %s", c->url));
|
LOG("*** Processing %s", c->url);
|
||||||
|
|
||||||
if (strlen(c->url) < 7) {
|
if (strlen(c->url) < 7) {
|
||||||
/* 7 is the minimum possible length (rsrc://) */
|
/* 7 is the minimum possible length (rsrc://) */
|
||||||
@ -198,11 +198,11 @@ static bool fetch_rsrc_process(struct fetch_rsrc_context *c)
|
|||||||
uint8 c1, c2, c3, c4;
|
uint8 c1, c2, c3, c4;
|
||||||
if (sscanf(params, "%c%c%c%c", &c1, &c2, &c3, &c4) > 3) {
|
if (sscanf(params, "%c%c%c%c", &c1, &c2, &c3, &c4) > 3) {
|
||||||
type = c1 << 24 | c2 << 16 | c3 << 8 | c4;
|
type = c1 << 24 | c2 << 16 | c3 << 8 | c4;
|
||||||
LOG(("fetch_rsrc: type:%4.4s\n", &type));
|
LOG("fetch_rsrc: type:%4.4s\n", &type);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
LOG(("fetch_rsrc: 0x%08lx, %ld, '%s'\n", type, id, c->name));
|
LOG("fetch_rsrc: 0x%08lx, %ld, '%s'\n", type, id, c->name);
|
||||||
|
|
||||||
bool found;
|
bool found;
|
||||||
if (id)
|
if (id)
|
||||||
|
@ -125,7 +125,7 @@ bool nsfont_position_in_string(const plot_font_style_t *fstyle,
|
|||||||
const char *string, size_t length,
|
const char *string, size_t length,
|
||||||
int x, size_t *char_offset, int *actual_x)
|
int x, size_t *char_offset, int *actual_x)
|
||||||
{
|
{
|
||||||
//LOG(("(, '%s', %d, %d, , )", string, length, x));
|
//LOG("(, '%s', %d, %d, , )", string, length, x);
|
||||||
//fprintf(stderr, "%s(, '%s', %d, %d, , )\n", __FUNCTION__, string, length, x);
|
//fprintf(stderr, "%s(, '%s', %d, %d, , )\n", __FUNCTION__, string, length, x);
|
||||||
int index;
|
int index;
|
||||||
BFont font;
|
BFont font;
|
||||||
@ -183,7 +183,7 @@ bool nsfont_split(const plot_font_style_t *fstyle,
|
|||||||
int x, size_t *char_offset, int *actual_x)
|
int x, size_t *char_offset, int *actual_x)
|
||||||
{
|
{
|
||||||
//fprintf(stderr, "%s(, '%s', %d, %d, , )\n", __FUNCTION__, string, length, x);
|
//fprintf(stderr, "%s(, '%s', %d, %d, , )\n", __FUNCTION__, string, length, x);
|
||||||
//LOG(("(, '%s', %d, %d, , )", string, length, x));
|
//LOG("(, '%s', %d, %d, , )", string, length, x);
|
||||||
int index = 0;
|
int index = 0;
|
||||||
BFont font;
|
BFont font;
|
||||||
|
|
||||||
|
16
beos/gui.cpp
16
beos/gui.cpp
@ -371,7 +371,7 @@ static nsurl *gui_get_resource_url(const char *path)
|
|||||||
path = "favicon.png";
|
path = "favicon.png";
|
||||||
|
|
||||||
u << path;
|
u << path;
|
||||||
LOG(("(%s) -> '%s'\n", path, u.String()));
|
LOG("(%s) -> '%s'\n", path, u.String());
|
||||||
nsurl_create(u.String(), &url);
|
nsurl_create(u.String(), &url);
|
||||||
return url;
|
return url;
|
||||||
}
|
}
|
||||||
@ -692,7 +692,7 @@ void nsbeos_pipe_message(BMessage *message, BView *_this, struct gui_window *gui
|
|||||||
if (gui)
|
if (gui)
|
||||||
message->AddPointer("gui_window", gui);
|
message->AddPointer("gui_window", gui);
|
||||||
int len = write(sEventPipe[1], &message, sizeof(void *));
|
int len = write(sEventPipe[1], &message, sizeof(void *));
|
||||||
//LOG(("nsbeos_pipe_message: %d written", len));
|
//LOG("nsbeos_pipe_message: %d written", len);
|
||||||
//printf("nsbeos_pipe_message: %d written\n", len);
|
//printf("nsbeos_pipe_message: %d written\n", len);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -708,7 +708,7 @@ void nsbeos_pipe_message_top(BMessage *message, BWindow *_this, struct beos_scaf
|
|||||||
if (scaffold)
|
if (scaffold)
|
||||||
message->AddPointer("scaffolding", scaffold);
|
message->AddPointer("scaffolding", scaffold);
|
||||||
int len = write(sEventPipe[1], &message, sizeof(void *));
|
int len = write(sEventPipe[1], &message, sizeof(void *));
|
||||||
//LOG(("nsbeos_pipe_message: %d written", len));
|
//LOG("nsbeos_pipe_message: %d written", len);
|
||||||
//printf("nsbeos_pipe_message: %d written\n", len);
|
//printf("nsbeos_pipe_message: %d written\n", len);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -747,17 +747,17 @@ void nsbeos_gui_poll(void)
|
|||||||
timeout.tv_sec = (long)(next_schedule / 1000000LL);
|
timeout.tv_sec = (long)(next_schedule / 1000000LL);
|
||||||
timeout.tv_usec = (long)(next_schedule % 1000000LL);
|
timeout.tv_usec = (long)(next_schedule % 1000000LL);
|
||||||
|
|
||||||
//LOG(("gui_poll: select(%d, ..., %Ldus", max_fd, next_schedule));
|
//LOG("gui_poll: select(%d, ..., %Ldus", max_fd, next_schedule);
|
||||||
fd_count = select(max_fd, &read_fd_set, &write_fd_set, &exc_fd_set,
|
fd_count = select(max_fd, &read_fd_set, &write_fd_set, &exc_fd_set,
|
||||||
&timeout);
|
&timeout);
|
||||||
//LOG(("select: %d\n", fd_count));
|
//LOG("select: %d\n", fd_count);
|
||||||
|
|
||||||
if (fd_count > 0 && FD_ISSET(sEventPipe[0], &read_fd_set)) {
|
if (fd_count > 0 && FD_ISSET(sEventPipe[0], &read_fd_set)) {
|
||||||
BMessage *message;
|
BMessage *message;
|
||||||
int len = read(sEventPipe[0], &message, sizeof(void *));
|
int len = read(sEventPipe[0], &message, sizeof(void *));
|
||||||
//LOG(("gui_poll: BMessage ? %d read", len));
|
//LOG("gui_poll: BMessage ? %d read", len);
|
||||||
if (len == sizeof(void *)) {
|
if (len == sizeof(void *)) {
|
||||||
//LOG(("gui_poll: BMessage.what %-4.4s\n", &(message->what)));
|
//LOG("gui_poll: BMessage.what %-4.4s\n", &(message->what));
|
||||||
nsbeos_dispatch_event(message);
|
nsbeos_dispatch_event(message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -921,7 +921,7 @@ static nserror gui_launch_url(struct nsurl *url)
|
|||||||
|
|
||||||
void warn_user(const char *warning, const char *detail)
|
void warn_user(const char *warning, const char *detail)
|
||||||
{
|
{
|
||||||
LOG(("warn_user: %s (%s)", warning, detail));
|
LOG("warn_user: %s (%s)", warning, detail);
|
||||||
BAlert *alert;
|
BAlert *alert;
|
||||||
BString text(warning);
|
BString text(warning);
|
||||||
if (detail)
|
if (detail)
|
||||||
|
@ -484,7 +484,7 @@ bool nsbeos_plot_path(const float *p, unsigned int n, colour fill, float width,
|
|||||||
return true;
|
return true;
|
||||||
|
|
||||||
if (p[0] != PLOTTER_PATH_MOVE) {
|
if (p[0] != PLOTTER_PATH_MOVE) {
|
||||||
LOG(("path doesn't start with a move"));
|
LOG("path doesn't start with a move");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -511,7 +511,7 @@ bool nsbeos_plot_path(const float *p, unsigned int n, colour fill, float width,
|
|||||||
shape.BezierTo(pt);
|
shape.BezierTo(pt);
|
||||||
i += 7;
|
i += 7;
|
||||||
} else {
|
} else {
|
||||||
LOG(("bad path command %f", p[i]));
|
LOG("bad path command %f", p[i]);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -826,7 +826,7 @@ void nsbeos_scaffolding_dispatch_event(nsbeos_scaffolding *scaffold, BMessage *m
|
|||||||
bw = nsbeos_get_browser_for_gui(scaffold->top_level);
|
bw = nsbeos_get_browser_for_gui(scaffold->top_level);
|
||||||
bool reloadAll = false;
|
bool reloadAll = false;
|
||||||
|
|
||||||
LOG(("nsbeos_scaffolding_dispatch_event() what = 0x%08lx", message->what));
|
LOG("nsbeos_scaffolding_dispatch_event() what = 0x%08lx", message->what);
|
||||||
switch (message->what) {
|
switch (message->what) {
|
||||||
case B_QUIT_REQUESTED:
|
case B_QUIT_REQUESTED:
|
||||||
nsbeos_scaffolding_destroy(scaffold);
|
nsbeos_scaffolding_destroy(scaffold);
|
||||||
@ -970,7 +970,7 @@ void nsbeos_scaffolding_dispatch_event(nsbeos_scaffolding *scaffold, BMessage *m
|
|||||||
browser_window_key_press(bw, NS_KEY_PASTE);
|
browser_window_key_press(bw, NS_KEY_PASTE);
|
||||||
break;
|
break;
|
||||||
case B_SELECT_ALL:
|
case B_SELECT_ALL:
|
||||||
LOG(("Selecting all text"));
|
LOG("Selecting all text");
|
||||||
browser_window_key_press(bw, NS_KEY_SELECT_ALL);
|
browser_window_key_press(bw, NS_KEY_SELECT_ALL);
|
||||||
break;
|
break;
|
||||||
case B_NETPOSITIVE_BACK:
|
case B_NETPOSITIVE_BACK:
|
||||||
@ -1374,7 +1374,7 @@ static void recursively_set_menu_items_target(BMenu *menu, BHandler *handler)
|
|||||||
|
|
||||||
void nsbeos_attach_toplevel_view(nsbeos_scaffolding *g, BView *view)
|
void nsbeos_attach_toplevel_view(nsbeos_scaffolding *g, BView *view)
|
||||||
{
|
{
|
||||||
LOG(("Attaching view to scaffolding %p", g));
|
LOG("Attaching view to scaffolding %p", g);
|
||||||
|
|
||||||
// this is a replicant,... and it went bad
|
// this is a replicant,... and it went bad
|
||||||
if (!g->window) {
|
if (!g->window) {
|
||||||
@ -1651,7 +1651,7 @@ nsbeos_scaffolding *nsbeos_new_scaffolding(struct gui_window *toplevel)
|
|||||||
{
|
{
|
||||||
struct beos_scaffolding *g = (struct beos_scaffolding *)malloc(sizeof(*g));
|
struct beos_scaffolding *g = (struct beos_scaffolding *)malloc(sizeof(*g));
|
||||||
|
|
||||||
LOG(("Constructing a scaffold of %p for gui_window %p", g, toplevel));
|
LOG("Constructing a scaffold of %p for gui_window %p", g, toplevel);
|
||||||
|
|
||||||
g->top_level = toplevel;
|
g->top_level = toplevel;
|
||||||
g->being_destroyed = 0;
|
g->being_destroyed = 0;
|
||||||
|
@ -81,7 +81,7 @@ schedule_remove(void (*callback)(void *p), void *p)
|
|||||||
|
|
||||||
nserror beos_schedule(int t, void (*callback)(void *p), void *p)
|
nserror beos_schedule(int t, void (*callback)(void *p), void *p)
|
||||||
{
|
{
|
||||||
LOG(("t:%d cb:%p p:%p", t, cb->callback, cb->context));
|
LOG("t:%d cb:%p p:%p", t, cb->callback, cb->context);
|
||||||
|
|
||||||
if (callbacks == NULL) {
|
if (callbacks == NULL) {
|
||||||
callbacks = new BList;
|
callbacks = new BList;
|
||||||
@ -111,7 +111,7 @@ nserror beos_schedule(int t, void (*callback)(void *p), void *p)
|
|||||||
bool
|
bool
|
||||||
schedule_run(void)
|
schedule_run(void)
|
||||||
{
|
{
|
||||||
LOG(("schedule_run()"));
|
LOG("schedule_run()");
|
||||||
|
|
||||||
earliest_callback_timeout = B_INFINITE_TIMEOUT;
|
earliest_callback_timeout = B_INFINITE_TIMEOUT;
|
||||||
if (callbacks == NULL)
|
if (callbacks == NULL)
|
||||||
@ -120,7 +120,7 @@ schedule_run(void)
|
|||||||
bigtime_t now = system_time();
|
bigtime_t now = system_time();
|
||||||
int32 i;
|
int32 i;
|
||||||
|
|
||||||
LOG(("Checking %ld callbacks to for deadline.", this_run->CountItems()));
|
LOG("Checking %ld callbacks to for deadline.", this_run->CountItems());
|
||||||
|
|
||||||
/* Run all the callbacks which made it this far. */
|
/* Run all the callbacks which made it this far. */
|
||||||
for (i = 0; i < callbacks->CountItems(); ) {
|
for (i = 0; i < callbacks->CountItems(); ) {
|
||||||
@ -132,7 +132,7 @@ schedule_run(void)
|
|||||||
i++;
|
i++;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
LOG(("Running callbacks %p(%p).", cb->callback, cb->context));
|
LOG("Running callbacks %p(%p).", cb->callback, cb->context);
|
||||||
if (!cb->callback_killed)
|
if (!cb->callback_killed)
|
||||||
cb->callback(cb->context);
|
cb->callback(cb->context);
|
||||||
callbacks->RemoveItem(cb);
|
callbacks->RemoveItem(cb);
|
||||||
|
@ -50,15 +50,14 @@ bool nsbeos_throbber_initialise_from_png(const int frames, ...)
|
|||||||
|
|
||||||
if (frames < 2) {
|
if (frames < 2) {
|
||||||
/* we need at least two frames - one for idle, one for active */
|
/* we need at least two frames - one for idle, one for active */
|
||||||
LOG(("Insufficent number of frames in throbber animation!"));
|
LOG("Insufficent number of frames in throbber animation!");
|
||||||
LOG(("(called with %d frames, where 2 is a minimum.)",
|
LOG("(called with %d frames, where 2 is a minimum.)", frames);
|
||||||
frames));
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
BResources *res = get_app_resources();
|
BResources *res = get_app_resources();
|
||||||
if (res == NULL) {
|
if (res == NULL) {
|
||||||
LOG(("Can't find resources for throbber!"));
|
LOG("Can't find resources for throbber!");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -75,14 +74,14 @@ bool nsbeos_throbber_initialise_from_png(const int frames, ...)
|
|||||||
data = res->LoadResource('data', fn, &size);
|
data = res->LoadResource('data', fn, &size);
|
||||||
throb->framedata[i] = NULL;
|
throb->framedata[i] = NULL;
|
||||||
if (!data) {
|
if (!data) {
|
||||||
LOG(("Error when loading resource %s", fn));
|
LOG("Error when loading resource %s", fn);
|
||||||
errors_when_loading = true;
|
errors_when_loading = true;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
BMemoryIO mem(data, size);
|
BMemoryIO mem(data, size);
|
||||||
throb->framedata[i] = BTranslationUtils::GetBitmap(&mem);
|
throb->framedata[i] = BTranslationUtils::GetBitmap(&mem);
|
||||||
if (throb->framedata[i] == NULL) {
|
if (throb->framedata[i] == NULL) {
|
||||||
LOG(("Error when loading %s: GetBitmap() returned NULL", fn));
|
LOG("Error when loading %s: GetBitmap() returned NULL", fn);
|
||||||
errors_when_loading = true;
|
errors_when_loading = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -351,7 +351,7 @@ static struct gui_window *gui_window_create(struct browser_window *bw,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
LOG(("Creating gui window %p for browser window %p", g, bw));
|
LOG("Creating gui window %p for browser window %p", g, bw);
|
||||||
|
|
||||||
g->bw = bw;
|
g->bw = bw;
|
||||||
g->mouse.state = 0;
|
g->mouse.state = 0;
|
||||||
@ -451,7 +451,7 @@ void nsbeos_dispatch_event(BMessage *message)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
//LOG(("processing message"));
|
//LOG("processing message");
|
||||||
switch (message->what) {
|
switch (message->what) {
|
||||||
case B_QUIT_REQUESTED:
|
case B_QUIT_REQUESTED:
|
||||||
// from the BApplication
|
// from the BApplication
|
||||||
@ -950,10 +950,10 @@ static void gui_window_destroy(struct gui_window *g)
|
|||||||
g->next->prev = g->prev;
|
g->next->prev = g->prev;
|
||||||
|
|
||||||
|
|
||||||
LOG(("Destroying gui_window %p", g));
|
LOG("Destroying gui_window %p", g);
|
||||||
assert(g != NULL);
|
assert(g != NULL);
|
||||||
assert(g->bw != NULL);
|
assert(g->bw != NULL);
|
||||||
LOG((" Scaffolding: %p", g->scaffold));
|
LOG(" Scaffolding: %p", g->scaffold);
|
||||||
|
|
||||||
if (g->view == NULL)
|
if (g->view == NULL)
|
||||||
return;
|
return;
|
||||||
|
@ -758,7 +758,7 @@ void content_broadcast(struct content *c, content_msg msg,
|
|||||||
{
|
{
|
||||||
struct content_user *user, *next;
|
struct content_user *user, *next;
|
||||||
assert(c);
|
assert(c);
|
||||||
// LOG(("%p %s -> %d", c, c->url, msg));
|
// LOG("%p %s -> %d", c, c->url, msg);
|
||||||
for (user = c->user_list->next; user != 0; user = next) {
|
for (user = c->user_list->next; user != 0; user = next) {
|
||||||
next = user->next; /* user may be destroyed during callback */
|
next = user->next; /* user may be destroyed during callback */
|
||||||
if (user->callback != 0)
|
if (user->callback != 0)
|
||||||
|
@ -66,9 +66,9 @@
|
|||||||
|
|
||||||
/** Verbose fetcher logging */
|
/** Verbose fetcher logging */
|
||||||
#ifdef DEBUG_FETCH_VERBOSE
|
#ifdef DEBUG_FETCH_VERBOSE
|
||||||
#define FETCH_LOG(x) LOG(x)
|
#define FETCH_LOG(x...) LOG(x...)
|
||||||
#else
|
#else
|
||||||
#define FETCH_LOG(x)
|
#define FETCH_LOG(x...)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/** The maximum number of fetchers that can be added */
|
/** The maximum number of fetchers that can be added */
|
||||||
@ -159,8 +159,8 @@ static int get_fetcher_for_scheme(lwc_string *scheme)
|
|||||||
static bool fetch_dispatch_job(struct fetch *fetch)
|
static bool fetch_dispatch_job(struct fetch *fetch)
|
||||||
{
|
{
|
||||||
RING_REMOVE(queue_ring, fetch);
|
RING_REMOVE(queue_ring, fetch);
|
||||||
FETCH_LOG(("Attempting to start fetch %p, fetcher %p, url %s", fetch,
|
FETCH_LOG("Attempting to start fetch %p, fetcher %p, url %s", fetch,
|
||||||
fetch->fetcher_handle, nsurl_access(fetch->url)));
|
fetch->fetcher_handle, nsurl_access(fetch->url));
|
||||||
|
|
||||||
if (!fetchers[fetch->fetcherd].ops.start(fetch->fetcher_handle)) {
|
if (!fetchers[fetch->fetcherd].ops.start(fetch->fetcher_handle)) {
|
||||||
RING_INSERT(queue_ring, fetch); /* Put it back on the end of the queue */
|
RING_INSERT(queue_ring, fetch); /* Put it back on the end of the queue */
|
||||||
@ -245,7 +245,7 @@ static bool fetch_dispatch_jobs(void)
|
|||||||
RING_GETSIZE(struct fetch, queue_ring, all_queued);
|
RING_GETSIZE(struct fetch, queue_ring, all_queued);
|
||||||
RING_GETSIZE(struct fetch, fetch_ring, all_active);
|
RING_GETSIZE(struct fetch, fetch_ring, all_active);
|
||||||
|
|
||||||
FETCH_LOG(("queue_ring %i, fetch_ring %i", all_queued, all_active));
|
FETCH_LOG("queue_ring %i, fetch_ring %i", all_queued, all_active);
|
||||||
dump_rings();
|
dump_rings();
|
||||||
|
|
||||||
while ((all_queued != 0) &&
|
while ((all_queued != 0) &&
|
||||||
@ -253,12 +253,12 @@ static bool fetch_dispatch_jobs(void)
|
|||||||
fetch_choose_and_dispatch()) {
|
fetch_choose_and_dispatch()) {
|
||||||
all_queued--;
|
all_queued--;
|
||||||
all_active++;
|
all_active++;
|
||||||
FETCH_LOG(("%d queued, %d fetching",
|
FETCH_LOG("%d queued, %d fetching",
|
||||||
all_queued, all_active));
|
all_queued, all_active);
|
||||||
}
|
}
|
||||||
|
|
||||||
FETCH_LOG(("Fetch ring is now %d elements.", all_active));
|
FETCH_LOG("Fetch ring is now %d elements.", all_active);
|
||||||
FETCH_LOG(("Queue ring is now %d elements.", all_queued));
|
FETCH_LOG("Queue ring is now %d elements.", all_queued);
|
||||||
|
|
||||||
return (all_active > 0);
|
return (all_active > 0);
|
||||||
}
|
}
|
||||||
@ -268,7 +268,7 @@ static void fetcher_poll(void *unused)
|
|||||||
int fetcherd;
|
int fetcherd;
|
||||||
|
|
||||||
if (fetch_dispatch_jobs()) {
|
if (fetch_dispatch_jobs()) {
|
||||||
FETCH_LOG(("Polling fetchers"));
|
FETCH_LOG("Polling fetchers");
|
||||||
for (fetcherd = 0; fetcherd < MAX_FETCHERS; fetcherd++) {
|
for (fetcherd = 0; fetcherd < MAX_FETCHERS; fetcherd++) {
|
||||||
if (fetchers[fetcherd].refcount > 0) {
|
if (fetchers[fetcherd].refcount > 0) {
|
||||||
/* fetcher present */
|
/* fetcher present */
|
||||||
@ -390,12 +390,12 @@ nserror fetcher_fdset(fd_set *read_fd_set,
|
|||||||
int fetcherd; /* fetcher index */
|
int fetcherd; /* fetcher index */
|
||||||
|
|
||||||
if (!fetch_dispatch_jobs()) {
|
if (!fetch_dispatch_jobs()) {
|
||||||
FETCH_LOG(("No jobs"));
|
FETCH_LOG("No jobs");
|
||||||
*maxfd_out = -1;
|
*maxfd_out = -1;
|
||||||
return NSERROR_OK;
|
return NSERROR_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
FETCH_LOG(("Polling fetchers"));
|
FETCH_LOG("Polling fetchers");
|
||||||
|
|
||||||
for (fetcherd = 0; fetcherd < MAX_FETCHERS; fetcherd++) {
|
for (fetcherd = 0; fetcherd < MAX_FETCHERS; fetcherd++) {
|
||||||
if (fetchers[fetcherd].refcount > 0) {
|
if (fetchers[fetcherd].refcount > 0) {
|
||||||
@ -470,7 +470,7 @@ fetch_start(nsurl *url,
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
FETCH_LOG(("fetch %p, url '%s'", fetch, nsurl_access(url)));
|
FETCH_LOG("fetch %p, url '%s'", fetch, nsurl_access(url));
|
||||||
|
|
||||||
/* construct a new fetch structure */
|
/* construct a new fetch structure */
|
||||||
fetch->callback = callback;
|
fetch->callback = callback;
|
||||||
@ -558,7 +558,7 @@ fetch_start(nsurl *url,
|
|||||||
|
|
||||||
/* Ask the queue to run. */
|
/* Ask the queue to run. */
|
||||||
if (fetch_dispatch_jobs()) {
|
if (fetch_dispatch_jobs()) {
|
||||||
FETCH_LOG(("scheduling poll"));
|
FETCH_LOG("scheduling poll");
|
||||||
/* schedule active fetchers to run again in 10ms */
|
/* schedule active fetchers to run again in 10ms */
|
||||||
guit->browser->schedule(10, fetcher_poll, NULL);
|
guit->browser->schedule(10, fetcher_poll, NULL);
|
||||||
}
|
}
|
||||||
@ -570,15 +570,15 @@ fetch_start(nsurl *url,
|
|||||||
void fetch_abort(struct fetch *f)
|
void fetch_abort(struct fetch *f)
|
||||||
{
|
{
|
||||||
assert(f);
|
assert(f);
|
||||||
FETCH_LOG(("fetch %p, fetcher %p, url '%s'", f, f->fetcher_handle,
|
FETCH_LOG("fetch %p, fetcher %p, url '%s'", f, f->fetcher_handle,
|
||||||
nsurl_access(f->url)));
|
nsurl_access(f->url));
|
||||||
fetchers[f->fetcherd].ops.abort(f->fetcher_handle);
|
fetchers[f->fetcherd].ops.abort(f->fetcher_handle);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* exported interface documented in content/fetch.h */
|
/* exported interface documented in content/fetch.h */
|
||||||
void fetch_free(struct fetch *f)
|
void fetch_free(struct fetch *f)
|
||||||
{
|
{
|
||||||
FETCH_LOG(("Freeing fetch %p, fetcher %p", f, f->fetcher_handle));
|
FETCH_LOG("Freeing fetch %p, fetcher %p", f, f->fetcher_handle);
|
||||||
|
|
||||||
fetchers[f->fetcherd].ops.free(f->fetcher_handle);
|
fetchers[f->fetcherd].ops.free(f->fetcher_handle);
|
||||||
|
|
||||||
@ -711,7 +711,7 @@ void fetch_multipart_data_destroy(struct fetch_multipart_data *list)
|
|||||||
free(list->name);
|
free(list->name);
|
||||||
free(list->value);
|
free(list->value);
|
||||||
if (list->file) {
|
if (list->file) {
|
||||||
FETCH_LOG(("Freeing rawfile: %s", list->rawfile));
|
FETCH_LOG("Freeing rawfile: %s", list->rawfile);
|
||||||
free(list->rawfile);
|
free(list->rawfile);
|
||||||
}
|
}
|
||||||
free(list);
|
free(list);
|
||||||
@ -729,8 +729,8 @@ fetch_send_callback(const fetch_msg *msg, struct fetch *fetch)
|
|||||||
/* exported interface documented in content/fetch.h */
|
/* exported interface documented in content/fetch.h */
|
||||||
void fetch_remove_from_queues(struct fetch *fetch)
|
void fetch_remove_from_queues(struct fetch *fetch)
|
||||||
{
|
{
|
||||||
FETCH_LOG(("Fetch %p, fetcher %p can be freed",
|
FETCH_LOG("Fetch %p, fetcher %p can be freed",
|
||||||
fetch, fetch->fetcher_handle));
|
fetch, fetch->fetcher_handle);
|
||||||
|
|
||||||
/* Go ahead and free the fetch properly now */
|
/* Go ahead and free the fetch properly now */
|
||||||
if (fetch->fetch_is_active) {
|
if (fetch->fetch_is_active) {
|
||||||
@ -756,7 +756,7 @@ void fetch_remove_from_queues(struct fetch *fetch)
|
|||||||
/* exported interface documented in content/fetch.h */
|
/* exported interface documented in content/fetch.h */
|
||||||
void fetch_set_http_code(struct fetch *fetch, long http_code)
|
void fetch_set_http_code(struct fetch *fetch, long http_code)
|
||||||
{
|
{
|
||||||
FETCH_LOG(("Setting HTTP code to %ld", http_code));
|
FETCH_LOG("Setting HTTP code to %ld", http_code);
|
||||||
|
|
||||||
fetch->http_code = http_code;
|
fetch->http_code = http_code;
|
||||||
}
|
}
|
||||||
|
@ -1139,10 +1139,10 @@ build_entrymap(struct store_state *state)
|
|||||||
|
|
||||||
for (eloop = 1; eloop < state->last_entry; eloop++) {
|
for (eloop = 1; eloop < state->last_entry; eloop++) {
|
||||||
/*
|
/*
|
||||||
LOG(("entry:%d ident:0x%08x used:%d",
|
LOG("entry:%d ident:0x%08x used:%d",
|
||||||
eloop,
|
eloop,
|
||||||
BS_ADDRESS(state->entries[eloop].ident, state),
|
BS_ADDRESS(state->entries[eloop].ident, state),
|
||||||
state->entries[eloop].use_count));
|
state->entries[eloop].use_count);
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* update the address map to point at the entry */
|
/* update the address map to point at the entry */
|
||||||
|
@ -60,9 +60,9 @@
|
|||||||
//#define LLCACHE_TRACE 1
|
//#define LLCACHE_TRACE 1
|
||||||
|
|
||||||
#ifdef LLCACHE_TRACE
|
#ifdef LLCACHE_TRACE
|
||||||
#define LLCACHE_LOG(x) LOG(x)
|
#define LLCACHE_LOG(x...) LOG(x)
|
||||||
#else
|
#else
|
||||||
#define LLCACHE_LOG(x)
|
#define LLCACHE_LOG(x...) ((void) 0)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -313,7 +313,7 @@ static nserror llcache_object_user_new(llcache_handle_callback cb, void *pw,
|
|||||||
|
|
||||||
u->handle = h;
|
u->handle = h;
|
||||||
|
|
||||||
LLCACHE_LOG(("Created user %p (%p, %p, %p)", u, h, (void *) cb, pw));
|
LLCACHE_LOG("Created user %p (%p, %p, %p)", u, h, (void *) cb, pw);
|
||||||
|
|
||||||
*user = u;
|
*user = u;
|
||||||
|
|
||||||
@ -330,7 +330,7 @@ static nserror llcache_object_user_new(llcache_handle_callback cb, void *pw,
|
|||||||
*/
|
*/
|
||||||
static nserror llcache_object_user_destroy(llcache_object_user *user)
|
static nserror llcache_object_user_destroy(llcache_object_user *user)
|
||||||
{
|
{
|
||||||
LLCACHE_LOG(("Destroyed user %p", user));
|
LLCACHE_LOG("Destroyed user %p", user);
|
||||||
|
|
||||||
assert(user->next == NULL);
|
assert(user->next == NULL);
|
||||||
assert(user->prev == NULL);
|
assert(user->prev == NULL);
|
||||||
@ -374,7 +374,7 @@ static nserror llcache_object_remove_user(llcache_object *object,
|
|||||||
object->last_used = time(NULL);
|
object->last_used = time(NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
LLCACHE_LOG(("Removing user %p from %p", user, object));
|
LLCACHE_LOG("Removing user %p from %p", user, object);
|
||||||
|
|
||||||
return NSERROR_OK;
|
return NSERROR_OK;
|
||||||
}
|
}
|
||||||
@ -430,7 +430,7 @@ static nserror llcache_object_new(nsurl *url, llcache_object **result)
|
|||||||
if (obj == NULL)
|
if (obj == NULL)
|
||||||
return NSERROR_NOMEM;
|
return NSERROR_NOMEM;
|
||||||
|
|
||||||
LLCACHE_LOG(("Created object %p (%s)", obj, nsurl_access(url)));
|
LLCACHE_LOG("Created object %p (%s)", obj, nsurl_access(url));
|
||||||
|
|
||||||
obj->url = nsurl_ref(url);
|
obj->url = nsurl_ref(url);
|
||||||
|
|
||||||
@ -840,7 +840,7 @@ static nserror llcache_object_refetch(llcache_object *object)
|
|||||||
/* Reset fetch state */
|
/* Reset fetch state */
|
||||||
object->fetch.state = LLCACHE_FETCH_INIT;
|
object->fetch.state = LLCACHE_FETCH_INIT;
|
||||||
|
|
||||||
LLCACHE_LOG(("Refetching %p", object));
|
LLCACHE_LOG("Refetching %p", object);
|
||||||
|
|
||||||
/* Kick off fetch */
|
/* Kick off fetch */
|
||||||
object->fetch.fetch = fetch_start(object->url, object->fetch.referer,
|
object->fetch.fetch = fetch_start(object->url, object->fetch.referer,
|
||||||
@ -886,7 +886,7 @@ static nserror llcache_object_fetch(llcache_object *object, uint32_t flags,
|
|||||||
nsurl *referer_clone = NULL;
|
nsurl *referer_clone = NULL;
|
||||||
llcache_post_data *post_clone = NULL;
|
llcache_post_data *post_clone = NULL;
|
||||||
|
|
||||||
LLCACHE_LOG(("Starting fetch for %p", object));
|
LLCACHE_LOG("Starting fetch for %p", object);
|
||||||
|
|
||||||
if (post != NULL) {
|
if (post != NULL) {
|
||||||
error = llcache_post_data_clone(post, &post_clone);
|
error = llcache_post_data_clone(post, &post_clone);
|
||||||
@ -919,7 +919,7 @@ static nserror llcache_object_destroy(llcache_object *object)
|
|||||||
{
|
{
|
||||||
size_t i;
|
size_t i;
|
||||||
|
|
||||||
LLCACHE_LOG(("Destroying object %p", object));
|
LLCACHE_LOG("Destroying object %p", object);
|
||||||
|
|
||||||
if (object->source_data != NULL) {
|
if (object->source_data != NULL) {
|
||||||
if (object->store_state == LLCACHE_STATE_DISC) {
|
if (object->store_state == LLCACHE_STATE_DISC) {
|
||||||
@ -1010,7 +1010,7 @@ llcache_object_rfc2616_remaining_lifetime(const llcache_cache_control *cd)
|
|||||||
else
|
else
|
||||||
freshness_lifetime = 0;
|
freshness_lifetime = 0;
|
||||||
|
|
||||||
/* LLCACHE_LOG(("%d:%d", freshness_lifetime, current_age)); */
|
/* LLCACHE_LOG("%d:%d", freshness_lifetime, current_age); */
|
||||||
|
|
||||||
if ((cd->no_cache == LLCACHE_VALIDATE_FRESH) &&
|
if ((cd->no_cache == LLCACHE_VALIDATE_FRESH) &&
|
||||||
(freshness_lifetime > current_age)) {
|
(freshness_lifetime > current_age)) {
|
||||||
@ -1039,9 +1039,9 @@ static bool llcache_object_is_fresh(const llcache_object *object)
|
|||||||
|
|
||||||
remaining_lifetime = llcache_object_rfc2616_remaining_lifetime(cd);
|
remaining_lifetime = llcache_object_rfc2616_remaining_lifetime(cd);
|
||||||
|
|
||||||
LLCACHE_LOG(("%p: (%d > 0 || %d != %d)", object,
|
LLCACHE_LOG("%p: (%d > 0 || %d != %d)", object,
|
||||||
remaining_lifetime,
|
remaining_lifetime,
|
||||||
object->fetch.state, LLCACHE_FETCH_COMPLETE));
|
object->fetch.state, LLCACHE_FETCH_COMPLETE);
|
||||||
|
|
||||||
/* The object is fresh if:
|
/* The object is fresh if:
|
||||||
* - it was not forbidden from being returned from the cache
|
* - it was not forbidden from being returned from the cache
|
||||||
@ -1285,7 +1285,7 @@ llcache_serialise_metadata(llcache_object *object,
|
|||||||
datasize -= use;
|
datasize -= use;
|
||||||
}
|
}
|
||||||
|
|
||||||
LLCACHE_LOG(("Filled buffer with %d spare", datasize));
|
LLCACHE_LOG("Filled buffer with %d spare", datasize);
|
||||||
|
|
||||||
*data_out = data;
|
*data_out = data;
|
||||||
*datasize_out = allocsize - datasize;
|
*datasize_out = allocsize - datasize;
|
||||||
@ -1549,8 +1549,8 @@ llcache_object_retrieve_from_cache(nsurl *url,
|
|||||||
nserror error;
|
nserror error;
|
||||||
llcache_object *obj, *newest = NULL;
|
llcache_object *obj, *newest = NULL;
|
||||||
|
|
||||||
LLCACHE_LOG(("Searching cache for %s flags:%x referer:%s post:%p",
|
LLCACHE_LOG("Searching cache for %s flags:%x referer:%s post:%p",
|
||||||
nsurl_access(url), flags, referer==NULL?"":nsurl_access(referer), post));
|
nsurl_access(url), flags, referer==NULL?"":nsurl_access(referer), post);
|
||||||
|
|
||||||
/* Search for the most recently fetched matching object */
|
/* Search for the most recently fetched matching object */
|
||||||
for (obj = llcache->cached_objects; obj != NULL; obj = obj->next) {
|
for (obj = llcache->cached_objects; obj != NULL; obj = obj->next) {
|
||||||
@ -1567,7 +1567,7 @@ llcache_object_retrieve_from_cache(nsurl *url,
|
|||||||
* pull from persistant store.
|
* pull from persistant store.
|
||||||
*/
|
*/
|
||||||
if (newest == NULL) {
|
if (newest == NULL) {
|
||||||
LLCACHE_LOG(("No viable object found in llcache"));
|
LLCACHE_LOG("No viable object found in llcache");
|
||||||
|
|
||||||
error = llcache_object_new(url, &obj);
|
error = llcache_object_new(url, &obj);
|
||||||
if (error != NSERROR_OK)
|
if (error != NSERROR_OK)
|
||||||
@ -1576,7 +1576,7 @@ llcache_object_retrieve_from_cache(nsurl *url,
|
|||||||
/* attempt to retrieve object from persistant store */
|
/* attempt to retrieve object from persistant store */
|
||||||
error = llcache_object_fetch_persistant(obj, flags, referer, post, redirect_count);
|
error = llcache_object_fetch_persistant(obj, flags, referer, post, redirect_count);
|
||||||
if (error == NSERROR_OK) {
|
if (error == NSERROR_OK) {
|
||||||
LLCACHE_LOG(("retrived object from persistant store"));
|
LLCACHE_LOG("retrived object from persistant store");
|
||||||
|
|
||||||
/* set newest object from persistant store which
|
/* set newest object from persistant store which
|
||||||
* will cause the normal object handling to be used.
|
* will cause the normal object handling to be used.
|
||||||
@ -1594,7 +1594,7 @@ llcache_object_retrieve_from_cache(nsurl *url,
|
|||||||
|
|
||||||
if ((newest != NULL) && (llcache_object_is_fresh(newest))) {
|
if ((newest != NULL) && (llcache_object_is_fresh(newest))) {
|
||||||
/* Found a suitable object, and it's still fresh */
|
/* Found a suitable object, and it's still fresh */
|
||||||
LLCACHE_LOG(("Found fresh %p", newest));
|
LLCACHE_LOG("Found fresh %p", newest);
|
||||||
|
|
||||||
/* The client needs to catch up with the object's state.
|
/* The client needs to catch up with the object's state.
|
||||||
* This will occur the next time that llcache_poll is called.
|
* This will occur the next time that llcache_poll is called.
|
||||||
@ -1615,7 +1615,7 @@ llcache_object_retrieve_from_cache(nsurl *url,
|
|||||||
* failed, destroy cache object and fall though to
|
* failed, destroy cache object and fall though to
|
||||||
* cache miss to re-fetch
|
* cache miss to re-fetch
|
||||||
*/
|
*/
|
||||||
LLCACHE_LOG(("Persistant retrival failed for %p", newest));
|
LLCACHE_LOG("Persistant retrival failed for %p", newest);
|
||||||
|
|
||||||
llcache_object_remove_from_list(newest, &llcache->cached_objects);
|
llcache_object_remove_from_list(newest, &llcache->cached_objects);
|
||||||
llcache_object_destroy(newest);
|
llcache_object_destroy(newest);
|
||||||
@ -1636,7 +1636,7 @@ llcache_object_retrieve_from_cache(nsurl *url,
|
|||||||
if (error != NSERROR_OK)
|
if (error != NSERROR_OK)
|
||||||
return error;
|
return error;
|
||||||
|
|
||||||
LLCACHE_LOG(("Found candidate %p (%p)", obj, newest));
|
LLCACHE_LOG("Found candidate %p (%p)", obj, newest);
|
||||||
|
|
||||||
/* Clone candidate's cache data */
|
/* Clone candidate's cache data */
|
||||||
error = llcache_object_clone_cache_data(newest, obj, true);
|
error = llcache_object_clone_cache_data(newest, obj, true);
|
||||||
@ -1666,7 +1666,7 @@ llcache_object_retrieve_from_cache(nsurl *url,
|
|||||||
return NSERROR_OK;
|
return NSERROR_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
LLCACHE_LOG(("Persistant retrival failed for %p", newest));
|
LLCACHE_LOG("Persistant retrival failed for %p", newest);
|
||||||
|
|
||||||
/* retrival of source data from persistant store
|
/* retrival of source data from persistant store
|
||||||
* failed, destroy cache object and fall though to
|
* failed, destroy cache object and fall though to
|
||||||
@ -1717,8 +1717,8 @@ static nserror llcache_object_retrieve(nsurl *url, uint32_t flags,
|
|||||||
nsurl *defragmented_url;
|
nsurl *defragmented_url;
|
||||||
bool uncachable = false;
|
bool uncachable = false;
|
||||||
|
|
||||||
LLCACHE_LOG(("Retrieve %s (%x, %s, %p)", nsurl_access(url), flags,
|
LLCACHE_LOG("Retrieve %s (%x, %s, %p)", nsurl_access(url), flags,
|
||||||
referer==NULL?"":nsurl_access(referer), post));
|
referer==NULL?"":nsurl_access(referer), post);
|
||||||
|
|
||||||
|
|
||||||
/* Get rid of any url fragment */
|
/* Get rid of any url fragment */
|
||||||
@ -1783,7 +1783,7 @@ static nserror llcache_object_retrieve(nsurl *url, uint32_t flags,
|
|||||||
/* Returned object is already in the cached list */
|
/* Returned object is already in the cached list */
|
||||||
}
|
}
|
||||||
|
|
||||||
LLCACHE_LOG(("Retrieved %p", obj));
|
LLCACHE_LOG("Retrieved %p", obj);
|
||||||
|
|
||||||
*result = obj;
|
*result = obj;
|
||||||
|
|
||||||
@ -1816,7 +1816,7 @@ static nserror llcache_object_add_user(llcache_object *object,
|
|||||||
object->users->prev = user;
|
object->users->prev = user;
|
||||||
object->users = user;
|
object->users = user;
|
||||||
|
|
||||||
LLCACHE_LOG(("Adding user %p to %p", user, object));
|
LLCACHE_LOG("Adding user %p to %p", user, object);
|
||||||
|
|
||||||
return NSERROR_OK;
|
return NSERROR_OK;
|
||||||
}
|
}
|
||||||
@ -2473,7 +2473,7 @@ static void llcache_persist(void *p)
|
|||||||
|
|
||||||
ret = build_candidate_list(&lst, &lst_count);
|
ret = build_candidate_list(&lst, &lst_count);
|
||||||
if (ret != NSERROR_OK) {
|
if (ret != NSERROR_OK) {
|
||||||
LLCACHE_LOG(("Unable to construct candidate list for persisatnt writeout"));
|
LLCACHE_LOG("Unable to construct candidate list for persisatnt writeout");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2491,9 +2491,9 @@ static void llcache_persist(void *p)
|
|||||||
total_elapsed += elapsed;
|
total_elapsed += elapsed;
|
||||||
total_bandwidth = (total_written * 1000) / total_elapsed;
|
total_bandwidth = (total_written * 1000) / total_elapsed;
|
||||||
|
|
||||||
LLCACHE_LOG(("Wrote %d bytes in %dms bw:%d %s",
|
LLCACHE_LOG("Wrote %d bytes in %dms bw:%d %s",
|
||||||
written, elapsed, (written * 1000) / elapsed,
|
written, elapsed, (written * 1000) / elapsed,
|
||||||
nsurl_access(lst[idx]->url) ));
|
nsurl_access(lst[idx]->url) );
|
||||||
|
|
||||||
/* check to for the time quantum or the size
|
/* check to for the time quantum or the size
|
||||||
* (bandwidth) for this run being exceeded.
|
* (bandwidth) for this run being exceeded.
|
||||||
@ -2557,10 +2557,10 @@ static void llcache_persist(void *p)
|
|||||||
llcache->total_written += total_written;
|
llcache->total_written += total_written;
|
||||||
llcache->total_elapsed += total_elapsed;
|
llcache->total_elapsed += total_elapsed;
|
||||||
|
|
||||||
LLCACHE_LOG(("writeout size:%d time:%d bandwidth:%dbytes/s",
|
LLCACHE_LOG("writeout size:%d time:%d bandwidth:%dbytes/s",
|
||||||
total_written, total_elapsed, total_bandwidth));
|
total_written, total_elapsed, total_bandwidth);
|
||||||
|
|
||||||
LLCACHE_LOG(("Rescheduling writeout in %dms", next));
|
LLCACHE_LOG("Rescheduling writeout in %dms", next);
|
||||||
guit->browser->schedule(next, llcache_persist, NULL);
|
guit->browser->schedule(next, llcache_persist, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2577,7 +2577,7 @@ static void llcache_fetch_callback(const fetch_msg *msg, void *p)
|
|||||||
llcache_object *object = p;
|
llcache_object *object = p;
|
||||||
llcache_event event;
|
llcache_event event;
|
||||||
|
|
||||||
LLCACHE_LOG(("Fetch event %d for %p", msg->type, object));
|
LLCACHE_LOG("Fetch event %d for %p", msg->type, object);
|
||||||
|
|
||||||
switch (msg->type) {
|
switch (msg->type) {
|
||||||
case FETCH_HEADER:
|
case FETCH_HEADER:
|
||||||
@ -3118,7 +3118,7 @@ void llcache_clean(bool purge)
|
|||||||
int remaining_lifetime;
|
int remaining_lifetime;
|
||||||
uint32_t limit;
|
uint32_t limit;
|
||||||
|
|
||||||
LLCACHE_LOG(("Attempting cache clean"));
|
LLCACHE_LOG("Attempting cache clean");
|
||||||
|
|
||||||
/* If the cache is being purged set the size limit to zero. */
|
/* If the cache is being purged set the size limit to zero. */
|
||||||
if (purge) {
|
if (purge) {
|
||||||
@ -3138,7 +3138,8 @@ void llcache_clean(bool purge)
|
|||||||
(object->candidate_count == 0) &&
|
(object->candidate_count == 0) &&
|
||||||
(object->fetch.fetch == NULL) &&
|
(object->fetch.fetch == NULL) &&
|
||||||
(object->fetch.outstanding_query == false)) {
|
(object->fetch.outstanding_query == false)) {
|
||||||
LLCACHE_LOG(("Discarding uncachable object with no users (%p) %s", object, nsurl_access(object->url)));
|
LLCACHE_LOG("Discarding uncachable object with no users (%p) %s",
|
||||||
|
object, nsurl_access(object->url));
|
||||||
|
|
||||||
llcache_object_remove_from_list(object,
|
llcache_object_remove_from_list(object,
|
||||||
&llcache->uncached_objects);
|
&llcache->uncached_objects);
|
||||||
@ -3163,7 +3164,7 @@ void llcache_clean(bool purge)
|
|||||||
(object->fetch.outstanding_query == false) &&
|
(object->fetch.outstanding_query == false) &&
|
||||||
(remaining_lifetime <= 0)) {
|
(remaining_lifetime <= 0)) {
|
||||||
/* object is stale */
|
/* object is stale */
|
||||||
LLCACHE_LOG(("discarding stale cacheable object with no users or pending fetches (%p) %s", object, nsurl_access(object->url)));
|
LLCACHE_LOG("discarding stale cacheable object with no users or pending fetches (%p) %s", object, nsurl_access(object->url));
|
||||||
|
|
||||||
llcache_object_remove_from_list(object,
|
llcache_object_remove_from_list(object,
|
||||||
&llcache->cached_objects);
|
&llcache->cached_objects);
|
||||||
@ -3207,9 +3208,9 @@ void llcache_clean(bool purge)
|
|||||||
|
|
||||||
llcache_size -= object->source_len;
|
llcache_size -= object->source_len;
|
||||||
|
|
||||||
LLCACHE_LOG(("Freeing source data for %p len:%d",
|
LLCACHE_LOG("Freeing source data for %p len:%d",
|
||||||
object,
|
object,
|
||||||
object->source_len));
|
object->source_len);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3227,11 +3228,11 @@ void llcache_clean(bool purge)
|
|||||||
(object->fetch.outstanding_query == false) &&
|
(object->fetch.outstanding_query == false) &&
|
||||||
(object->store_state == LLCACHE_STATE_DISC) &&
|
(object->store_state == LLCACHE_STATE_DISC) &&
|
||||||
(object->source_data == NULL)) {
|
(object->source_data == NULL)) {
|
||||||
LLCACHE_LOG(("discarding backed object len:%d age:%d (%p) %s",
|
LLCACHE_LOG("discarding backed object len:%d age:%d (%p) %s",
|
||||||
object->source_len,
|
object->source_len,
|
||||||
time(NULL) - object->last_used,
|
time(NULL) - object->last_used,
|
||||||
object,
|
object,
|
||||||
nsurl_access(object->url)));
|
nsurl_access(object->url));
|
||||||
|
|
||||||
llcache_size -= total_object_size(object);
|
llcache_size -= total_object_size(object);
|
||||||
|
|
||||||
@ -3257,11 +3258,11 @@ void llcache_clean(bool purge)
|
|||||||
(object->fetch.fetch == NULL) &&
|
(object->fetch.fetch == NULL) &&
|
||||||
(object->fetch.outstanding_query == false) &&
|
(object->fetch.outstanding_query == false) &&
|
||||||
(object->store_state == LLCACHE_STATE_RAM)) {
|
(object->store_state == LLCACHE_STATE_RAM)) {
|
||||||
LLCACHE_LOG(("discarding fresh object len:%d age:%d (%p) %s",
|
LLCACHE_LOG("discarding fresh object len:%d age:%d (%p) %s",
|
||||||
object->source_len,
|
object->source_len,
|
||||||
time(NULL) - object->last_used,
|
time(NULL) - object->last_used,
|
||||||
object,
|
object,
|
||||||
nsurl_access(object->url)));
|
nsurl_access(object->url));
|
||||||
|
|
||||||
llcache_size -= object->source_len + sizeof(*object);
|
llcache_size -= object->source_len + sizeof(*object);
|
||||||
|
|
||||||
@ -3271,7 +3272,7 @@ void llcache_clean(bool purge)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
LLCACHE_LOG(("Size: %u", llcache_size));
|
LLCACHE_LOG("Size: %u", llcache_size);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Exported interface documented in content/llcache.h */
|
/* Exported interface documented in content/llcache.h */
|
||||||
|
@ -3733,7 +3733,7 @@ void urldb_load_cookies(const char *filename)
|
|||||||
for (; *p && *p != '\t'; p++) \
|
for (; *p && *p != '\t'; p++) \
|
||||||
; /* do nothing */ \
|
; /* do nothing */ \
|
||||||
if (p >= end) { \
|
if (p >= end) { \
|
||||||
LOG(("Overran input")); \
|
LOG("Overran input"); \
|
||||||
continue; \
|
continue; \
|
||||||
} \
|
} \
|
||||||
*p++ = '\0'; \
|
*p++ = '\0'; \
|
||||||
@ -3743,7 +3743,7 @@ void urldb_load_cookies(const char *filename)
|
|||||||
for (; *p && *p == '\t'; p++) \
|
for (; *p && *p == '\t'; p++) \
|
||||||
; /* do nothing */ \
|
; /* do nothing */ \
|
||||||
if (p >= end) { \
|
if (p >= end) { \
|
||||||
LOG(("Overran input")); \
|
LOG("Overran input"); \
|
||||||
continue; \
|
continue; \
|
||||||
} \
|
} \
|
||||||
}
|
}
|
||||||
|
@ -25,9 +25,9 @@
|
|||||||
#include "framebuffer/schedule.h"
|
#include "framebuffer/schedule.h"
|
||||||
|
|
||||||
#ifdef DEBUG_SCHEDULER
|
#ifdef DEBUG_SCHEDULER
|
||||||
#define SRLOG(x) LOG(x)
|
#define SRLOG(x...) LOG(x)
|
||||||
#else
|
#else
|
||||||
#define SRLOG(x)
|
#define SRLOG(x...) ((void) 0)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* linked list of scheduled callbacks */
|
/* linked list of scheduled callbacks */
|
||||||
@ -63,7 +63,7 @@ static nserror schedule_remove(void (*callback)(void *p), void *p)
|
|||||||
return NSERROR_OK;
|
return NSERROR_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
SRLOG(("removing %p, %p", callback, p));
|
SRLOG("removing %p, %p", callback, p);
|
||||||
|
|
||||||
cur_nscb = schedule_list;
|
cur_nscb = schedule_list;
|
||||||
prev_nscb = NULL;
|
prev_nscb = NULL;
|
||||||
@ -73,8 +73,8 @@ static nserror schedule_remove(void (*callback)(void *p), void *p)
|
|||||||
(cur_nscb->p == p)) {
|
(cur_nscb->p == p)) {
|
||||||
/* item to remove */
|
/* item to remove */
|
||||||
|
|
||||||
SRLOG(("callback entry %p removing %p(%p)",
|
SRLOG("callback entry %p removing %p(%p)",
|
||||||
cur_nscb, cur_nscb->callback, cur_nscb->p));
|
cur_nscb, cur_nscb->callback, cur_nscb->p);
|
||||||
|
|
||||||
/* remove callback */
|
/* remove callback */
|
||||||
unlnk_nscb = cur_nscb;
|
unlnk_nscb = cur_nscb;
|
||||||
@ -109,7 +109,7 @@ nserror framebuffer_schedule(int tival, void (*callback)(void *p), void *p)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
SRLOG(("Adding %p(%p) in %d", callback, p, tival));
|
SRLOG("Adding %p(%p) in %d", callback, p, tival);
|
||||||
|
|
||||||
tv.tv_sec = tival / 1000; /* miliseconds to seconds */
|
tv.tv_sec = tival / 1000; /* miliseconds to seconds */
|
||||||
tv.tv_usec = (tival % 1000) * 1000; /* remainder to microseconds */
|
tv.tv_usec = (tival % 1000) * 1000; /* remainder to microseconds */
|
||||||
@ -190,7 +190,7 @@ int schedule_run(void)
|
|||||||
/* make rettime relative to now */
|
/* make rettime relative to now */
|
||||||
timersub(&nexttime, &tv, &rettime);
|
timersub(&nexttime, &tv, &rettime);
|
||||||
|
|
||||||
SRLOG(("returning time to next event as %ldms",(rettime.tv_sec * 1000) + (rettime.tv_usec / 1000)));
|
SRLOG("returning time to next event as %ldms",(rettime.tv_sec * 1000) + (rettime.tv_usec / 1000));
|
||||||
|
|
||||||
/* return next event time in milliseconds (24days max wait) */
|
/* return next event time in milliseconds (24days max wait) */
|
||||||
return (rettime.tv_sec * 1000) + (rettime.tv_usec / 1000);
|
return (rettime.tv_sec * 1000) + (rettime.tv_usec / 1000);
|
||||||
|
@ -100,8 +100,8 @@ bool nsfont_width(const plot_font_style_t *fstyle,
|
|||||||
|
|
||||||
pango_font_description_free(desc);
|
pango_font_description_free(desc);
|
||||||
|
|
||||||
/* LOG(("fstyle: %p string:\"%.*s\", length: %u, width: %dpx",
|
/* LOG("fstyle: %p string:\"%.*s\", length: %u, width: %dpx",
|
||||||
fstyle, length, string, length, *width));
|
fstyle, length, string, length, *width);
|
||||||
*/
|
*/
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
@ -45,10 +45,10 @@ typedef struct nssprite_content {
|
|||||||
#define ERRCHK(x) do { \
|
#define ERRCHK(x) do { \
|
||||||
rosprite_error err = x; \
|
rosprite_error err = x; \
|
||||||
if (err == ROSPRITE_EOF) { \
|
if (err == ROSPRITE_EOF) { \
|
||||||
LOG(("Got ROSPRITE_EOF when loading sprite file")); \
|
LOG("Got ROSPRITE_EOF when loading sprite file"); \
|
||||||
return false; \
|
return false; \
|
||||||
} else if (err == ROSPRITE_BADMODE) { \
|
} else if (err == ROSPRITE_BADMODE) { \
|
||||||
LOG(("Got ROSPRITE_BADMODE when loading sprite file")); \
|
LOG("Got ROSPRITE_BADMODE when loading sprite file"); \
|
||||||
return false; \
|
return false; \
|
||||||
} else if (err == ROSPRITE_OK) { \
|
} else if (err == ROSPRITE_OK) { \
|
||||||
} else { \
|
} else { \
|
||||||
|
@ -706,7 +706,7 @@ dom_event_fetcher(dom_string *type,
|
|||||||
dom_default_action_phase phase,
|
dom_default_action_phase phase,
|
||||||
void **pw)
|
void **pw)
|
||||||
{
|
{
|
||||||
//LOG(("type:%s", dom_string_data(type)));
|
//LOG("type:%s", dom_string_data(type));
|
||||||
|
|
||||||
if (phase == DOM_DEFAULT_ACTION_END) {
|
if (phase == DOM_DEFAULT_ACTION_END) {
|
||||||
if (dom_string_isequal(type, corestring_dom_DOMNodeInserted)) {
|
if (dom_string_isequal(type, corestring_dom_DOMNodeInserted)) {
|
||||||
|
@ -151,8 +151,8 @@ void ro_gui_options_image_redraw(wimp_draw *redraw)
|
|||||||
icon_state.i = IMAGE_CURRENT_DISPLAY;
|
icon_state.i = IMAGE_CURRENT_DISPLAY;
|
||||||
error = xwimp_get_icon_state(&icon_state);
|
error = xwimp_get_icon_state(&icon_state);
|
||||||
if (error) {
|
if (error) {
|
||||||
LOG(("xwimp_get_icon_state: 0x%x: %s",
|
LOG("xwimp_get_icon_state: 0x%x: %s",
|
||||||
error->errnum, error->errmess));
|
error->errnum, error->errmess);
|
||||||
warn_user("MenuError", error->errmess);
|
warn_user("MenuError", error->errmess);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -272,8 +272,8 @@ set_colour_from_wimp(struct nsoption_s *opts,
|
|||||||
|
|
||||||
error = xwimp_read_true_palette((os_palette *) &palette);
|
error = xwimp_read_true_palette((os_palette *) &palette);
|
||||||
if (error != NULL) {
|
if (error != NULL) {
|
||||||
LOG(("xwimp_read_palette: 0x%x: %s",
|
LOG("xwimp_read_palette: 0x%x: %s",
|
||||||
error->errnum, error->errmess));
|
error->errnum, error->errmess);
|
||||||
} else {
|
} else {
|
||||||
/* entries are in B0G0R0LL */
|
/* entries are in B0G0R0LL */
|
||||||
def_colour = palette.entries[wimp] >> 8;
|
def_colour = palette.entries[wimp] >> 8;
|
||||||
|
@ -473,7 +473,7 @@ void ro_gui_selection_data_request(wimp_full_message_data_request *req)
|
|||||||
// bits ftype = req->file_types[i];
|
// bits ftype = req->file_types[i];
|
||||||
// if (ftype == ~0U) break; /* list terminator */
|
// if (ftype == ~0U) break; /* list terminator */
|
||||||
//
|
//
|
||||||
// LOG(("type %x", ftype));
|
// LOG("type %x", ftype);
|
||||||
// i++;
|
// i++;
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
@ -182,8 +182,8 @@ static void ro_gui_theme_get_available_in_dir(const char *directory)
|
|||||||
(osgbpb_info_list *) &info, 1, context,
|
(osgbpb_info_list *) &info, 1, context,
|
||||||
sizeof(info), 0, &read_count, &context);
|
sizeof(info), 0, &read_count, &context);
|
||||||
if (error) {
|
if (error) {
|
||||||
LOG(("xosgbpb_dir_entries_info: 0x%x: %s",
|
LOG("xosgbpb_dir_entries_info: 0x%x: %s",
|
||||||
error->errnum, error->errmess));
|
error->errnum, error->errmess);
|
||||||
if (error->errnum == 0xd6) /* no such dir */
|
if (error->errnum == 0xd6) /* no such dir */
|
||||||
return;
|
return;
|
||||||
warn_user("MiscError", error->errmess);
|
warn_user("MiscError", error->errmess);
|
||||||
|
@ -208,7 +208,7 @@ static void container_process(struct container_ctx *ctx)
|
|||||||
/* now work through the directory structure taking it apart into
|
/* now work through the directory structure taking it apart into
|
||||||
* our structure */
|
* our structure */
|
||||||
#define BEREAD(x) do { val = fread(&(x), 4, 1, ctx->fh); if (val == 0)\
|
#define BEREAD(x) do { val = fread(&(x), 4, 1, ctx->fh); if (val == 0)\
|
||||||
LOG(("empty read"));(x) = ntohl((x)); } while (0)
|
LOG("empty read");(x) = ntohl((x)); } while (0)
|
||||||
do {
|
do {
|
||||||
val = fread(filename, 64, 1, ctx->fh);
|
val = fread(filename, 64, 1, ctx->fh);
|
||||||
if (val == 0)
|
if (val == 0)
|
||||||
@ -295,7 +295,7 @@ static void container_write_dir(struct container_ctx *ctx)
|
|||||||
unsigned int i;
|
unsigned int i;
|
||||||
u_int32_t tmp;
|
u_int32_t tmp;
|
||||||
#define BEWRITE(x) do {tmp = htonl((x)); val = fwrite(&tmp, 4, 1, ctx->fh);\
|
#define BEWRITE(x) do {tmp = htonl((x)); val = fwrite(&tmp, 4, 1, ctx->fh);\
|
||||||
if (val == 0) LOG(("empty write")); } while(0)
|
if (val == 0) LOG("empty write"); } while(0)
|
||||||
for (i = 1; i <= ctx->entries; i++) {
|
for (i = 1; i <= ctx->entries; i++) {
|
||||||
struct container_dirent *e = ctx->directory + i - 1;
|
struct container_dirent *e = ctx->directory + i - 1;
|
||||||
val = fwrite(e->filename, 64, 1, ctx->fh);
|
val = fwrite(e->filename, 64, 1, ctx->fh);
|
||||||
|
14
utils/ring.h
14
utils/ring.h
@ -38,7 +38,7 @@
|
|||||||
* Assumes that the element is zeroed as appropriate.
|
* Assumes that the element is zeroed as appropriate.
|
||||||
*/
|
*/
|
||||||
#define RING_INSERT(ring,element) \
|
#define RING_INSERT(ring,element) \
|
||||||
/*LOG(("RING_INSERT(%s, %p(%s))", #ring, element, element->host));*/ \
|
/*LOG("RING_INSERT(%s, %p(%s))", #ring, element, element->host);*/ \
|
||||||
if (ring) { \
|
if (ring) { \
|
||||||
element->r_next = ring; \
|
element->r_next = ring; \
|
||||||
element->r_prev = ring->r_prev; \
|
element->r_prev = ring->r_prev; \
|
||||||
@ -51,7 +51,7 @@
|
|||||||
* Will zero the element as needed
|
* Will zero the element as needed
|
||||||
*/
|
*/
|
||||||
#define RING_REMOVE(ring, element) \
|
#define RING_REMOVE(ring, element) \
|
||||||
/*LOG(("RING_REMOVE(%s, %p(%s)", #ring, element, element->host));*/ \
|
/*LOG("RING_REMOVE(%s, %p(%s)", #ring, element, element->host);*/ \
|
||||||
if (element->r_next != element ) { \
|
if (element->r_next != element ) { \
|
||||||
/* Not the only thing in the ring */ \
|
/* Not the only thing in the ring */ \
|
||||||
element->r_next->r_prev = element->r_prev; \
|
element->r_next->r_prev = element->r_prev; \
|
||||||
@ -67,7 +67,7 @@
|
|||||||
* provided element variable
|
* provided element variable
|
||||||
*/
|
*/
|
||||||
#define RING_FINDBYHOST(ring, element, hostname) \
|
#define RING_FINDBYHOST(ring, element, hostname) \
|
||||||
/*LOG(("RING_FINDBYHOST(%s, %s)", #ring, hostname));*/ \
|
/*LOG("RING_FINDBYHOST(%s, %s)", #ring, hostname);*/ \
|
||||||
if (ring) { \
|
if (ring) { \
|
||||||
bool found = false; \
|
bool found = false; \
|
||||||
element = ring; \
|
element = ring; \
|
||||||
@ -85,7 +85,7 @@
|
|||||||
* provided element variable
|
* provided element variable
|
||||||
*/
|
*/
|
||||||
#define RING_FINDBYLWCHOST(ring, element, lwc_hostname) \
|
#define RING_FINDBYLWCHOST(ring, element, lwc_hostname) \
|
||||||
/*LOG(("RING_FINDBYHOST(%s, %s)", #ring, hostname));*/ \
|
/*LOG("RING_FINDBYHOST(%s, %s)", #ring, hostname);*/ \
|
||||||
if (ring) { \
|
if (ring) { \
|
||||||
bool found = false; \
|
bool found = false; \
|
||||||
element = ring; \
|
element = ring; \
|
||||||
@ -102,7 +102,7 @@
|
|||||||
|
|
||||||
/** Measure the size of a ring and put it in the supplied variable */
|
/** Measure the size of a ring and put it in the supplied variable */
|
||||||
#define RING_GETSIZE(ringtype, ring, sizevar) \
|
#define RING_GETSIZE(ringtype, ring, sizevar) \
|
||||||
/*LOG(("RING_GETSIZE(%s)", #ring));*/ \
|
/*LOG("RING_GETSIZE(%s)", #ring);*/ \
|
||||||
if (ring) { \
|
if (ring) { \
|
||||||
ringtype *p = ring; \
|
ringtype *p = ring; \
|
||||||
sizevar = 0; \
|
sizevar = 0; \
|
||||||
@ -114,7 +114,7 @@
|
|||||||
|
|
||||||
/** Count the number of elements in the ring which match the provided hostname */
|
/** Count the number of elements in the ring which match the provided hostname */
|
||||||
#define RING_COUNTBYHOST(ringtype, ring, sizevar, hostname) \
|
#define RING_COUNTBYHOST(ringtype, ring, sizevar, hostname) \
|
||||||
/*LOG(("RING_COUNTBYHOST(%s, %s)", #ring, hostname));*/ \
|
/*LOG("RING_COUNTBYHOST(%s, %s)", #ring, hostname);*/ \
|
||||||
if (ring) { \
|
if (ring) { \
|
||||||
ringtype *p = ring; \
|
ringtype *p = ring; \
|
||||||
sizevar = 0; \
|
sizevar = 0; \
|
||||||
@ -127,7 +127,7 @@
|
|||||||
|
|
||||||
/** Count the number of elements in the ring which match the provided lwc_hostname */
|
/** Count the number of elements in the ring which match the provided lwc_hostname */
|
||||||
#define RING_COUNTBYLWCHOST(ringtype, ring, sizevar, lwc_hostname) \
|
#define RING_COUNTBYLWCHOST(ringtype, ring, sizevar, lwc_hostname) \
|
||||||
/*LOG(("RING_COUNTBYHOST(%s, %s)", #ring, hostname));*/ \
|
/*LOG("RING_COUNTBYHOST(%s, %s)", #ring, hostname);*/ \
|
||||||
if (ring) { \
|
if (ring) { \
|
||||||
ringtype *p = ring; \
|
ringtype *p = ring; \
|
||||||
sizevar = 0; \
|
sizevar = 0; \
|
||||||
|
@ -42,9 +42,9 @@
|
|||||||
/* #define NSWS_PLOT_DEBUG */
|
/* #define NSWS_PLOT_DEBUG */
|
||||||
|
|
||||||
#ifdef NSWS_PLOT_DEBUG
|
#ifdef NSWS_PLOT_DEBUG
|
||||||
#define PLOT_LOG(x) LOG(x)
|
#define PLOT_LOG(x...) LOG(x)
|
||||||
#else
|
#else
|
||||||
#define PLOT_LOG(x)
|
#define PLOT_LOG(x...) ((void) 0)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
HDC plot_hdc;
|
HDC plot_hdc;
|
||||||
@ -53,7 +53,7 @@ static RECT plot_clip; /* currently set clipping rectangle */
|
|||||||
|
|
||||||
static bool clip(const struct rect *clip)
|
static bool clip(const struct rect *clip)
|
||||||
{
|
{
|
||||||
PLOT_LOG(("clip %d,%d to %d,%d", clip->x0, clip->y0, clip->x1, clip->y1));
|
PLOT_LOG("clip %d,%d to %d,%d", clip->x0, clip->y0, clip->x1, clip->y1);
|
||||||
|
|
||||||
plot_clip.left = clip->x0;
|
plot_clip.left = clip->x0;
|
||||||
plot_clip.top = clip->y0;
|
plot_clip.top = clip->y0;
|
||||||
@ -65,7 +65,7 @@ static bool clip(const struct rect *clip)
|
|||||||
|
|
||||||
static bool line(int x0, int y0, int x1, int y1, const plot_style_t *style)
|
static bool line(int x0, int y0, int x1, int y1, const plot_style_t *style)
|
||||||
{
|
{
|
||||||
PLOT_LOG(("from %d,%d to %d,%d", x0, y0, x1, y1));
|
PLOT_LOG("from %d,%d to %d,%d", x0, y0, x1, y1);
|
||||||
|
|
||||||
/* ensure the plot HDC is set */
|
/* ensure the plot HDC is set */
|
||||||
if (plot_hdc == NULL) {
|
if (plot_hdc == NULL) {
|
||||||
@ -120,7 +120,7 @@ static bool line(int x0, int y0, int x1, int y1, const plot_style_t *style)
|
|||||||
|
|
||||||
static bool rectangle(int x0, int y0, int x1, int y1, const plot_style_t *style)
|
static bool rectangle(int x0, int y0, int x1, int y1, const plot_style_t *style)
|
||||||
{
|
{
|
||||||
PLOT_LOG(("rectangle from %d,%d to %d,%d", x0, y0, x1, y1));
|
PLOT_LOG("rectangle from %d,%d to %d,%d", x0, y0, x1, y1);
|
||||||
|
|
||||||
/* ensure the plot HDC is set */
|
/* ensure the plot HDC is set */
|
||||||
if (plot_hdc == NULL) {
|
if (plot_hdc == NULL) {
|
||||||
@ -187,7 +187,7 @@ static bool rectangle(int x0, int y0, int x1, int y1, const plot_style_t *style)
|
|||||||
|
|
||||||
static bool polygon(const int *p, unsigned int n, const plot_style_t *style)
|
static bool polygon(const int *p, unsigned int n, const plot_style_t *style)
|
||||||
{
|
{
|
||||||
PLOT_LOG(("polygon %d points", n));
|
PLOT_LOG("polygon %d points", n);
|
||||||
|
|
||||||
/* ensure the plot HDC is set */
|
/* ensure the plot HDC is set */
|
||||||
if (plot_hdc == NULL) {
|
if (plot_hdc == NULL) {
|
||||||
@ -235,7 +235,7 @@ static bool polygon(const int *p, unsigned int n, const plot_style_t *style)
|
|||||||
points[i].x = (long) p[2 * i];
|
points[i].x = (long) p[2 * i];
|
||||||
points[i].y = (long) p[2 * i + 1];
|
points[i].y = (long) p[2 * i + 1];
|
||||||
|
|
||||||
PLOT_LOG(("%ld,%ld ", points[i].x, points[i].y));
|
PLOT_LOG("%ld,%ld ", points[i].x, points[i].y);
|
||||||
}
|
}
|
||||||
|
|
||||||
SelectClipRgn(plot_hdc, clipregion);
|
SelectClipRgn(plot_hdc, clipregion);
|
||||||
@ -258,7 +258,7 @@ static bool polygon(const int *p, unsigned int n, const plot_style_t *style)
|
|||||||
static bool text(int x, int y, const char *text, size_t length,
|
static bool text(int x, int y, const char *text, size_t length,
|
||||||
const plot_font_style_t *style)
|
const plot_font_style_t *style)
|
||||||
{
|
{
|
||||||
PLOT_LOG(("words %s at %d,%d", text, x, y));
|
PLOT_LOG("words %s at %d,%d", text, x, y);
|
||||||
|
|
||||||
/* ensure the plot HDC is set */
|
/* ensure the plot HDC is set */
|
||||||
if (plot_hdc == NULL) {
|
if (plot_hdc == NULL) {
|
||||||
@ -317,7 +317,7 @@ static bool text(int x, int y, const char *text, size_t length,
|
|||||||
|
|
||||||
static bool disc(int x, int y, int radius, const plot_style_t *style)
|
static bool disc(int x, int y, int radius, const plot_style_t *style)
|
||||||
{
|
{
|
||||||
PLOT_LOG(("disc at %d,%d radius %d", x, y, radius));
|
PLOT_LOG("disc at %d,%d radius %d", x, y, radius);
|
||||||
|
|
||||||
/* ensure the plot HDC is set */
|
/* ensure the plot HDC is set */
|
||||||
if (plot_hdc == NULL) {
|
if (plot_hdc == NULL) {
|
||||||
@ -387,8 +387,8 @@ static bool disc(int x, int y, int radius, const plot_style_t *style)
|
|||||||
static bool arc(int x, int y, int radius, int angle1, int angle2,
|
static bool arc(int x, int y, int radius, int angle1, int angle2,
|
||||||
const plot_style_t *style)
|
const plot_style_t *style)
|
||||||
{
|
{
|
||||||
PLOT_LOG(("arc centre %d,%d radius %d from %d to %d", x, y, radius,
|
PLOT_LOG("arc centre %d,%d radius %d from %d to %d", x, y, radius,
|
||||||
angle1, angle2));
|
angle1, angle2);
|
||||||
|
|
||||||
/* ensure the plot HDC is set */
|
/* ensure the plot HDC is set */
|
||||||
if (plot_hdc == NULL) {
|
if (plot_hdc == NULL) {
|
||||||
@ -565,8 +565,8 @@ plot_alpha_bitmap(HDC hdc,
|
|||||||
BITMAPINFO *bmi;
|
BITMAPINFO *bmi;
|
||||||
HBITMAP MemBMh;
|
HBITMAP MemBMh;
|
||||||
|
|
||||||
PLOT_LOG(("%p bitmap %d,%d width %d height %d", bitmap, x, y, width, height));
|
PLOT_LOG("%p bitmap %d,%d width %d height %d", bitmap, x, y, width, height);
|
||||||
PLOT_LOG(("clipped %ld,%ld to %ld,%ld",plot_clip.left, plot_clip.top, plot_clip.right, plot_clip.bottom));
|
PLOT_LOG("clipped %ld,%ld to %ld,%ld",plot_clip.left, plot_clip.top, plot_clip.right, plot_clip.bottom);
|
||||||
|
|
||||||
Memhdc = CreateCompatibleDC(hdc);
|
Memhdc = CreateCompatibleDC(hdc);
|
||||||
if (Memhdc == NULL) {
|
if (Memhdc == NULL) {
|
||||||
@ -575,8 +575,8 @@ plot_alpha_bitmap(HDC hdc,
|
|||||||
|
|
||||||
if ((bitmap->width != width) ||
|
if ((bitmap->width != width) ||
|
||||||
(bitmap->height != height)) {
|
(bitmap->height != height)) {
|
||||||
PLOT_LOG(("scaling from %d,%d to %d,%d",
|
PLOT_LOG("scaling from %d,%d to %d,%d",
|
||||||
bitmap->width, bitmap->height, width, height));
|
bitmap->width, bitmap->height, width, height);
|
||||||
bitmap = bitmap_scale(bitmap, width, height);
|
bitmap = bitmap_scale(bitmap, width, height);
|
||||||
if (bitmap == NULL)
|
if (bitmap == NULL)
|
||||||
return false;
|
return false;
|
||||||
@ -735,7 +735,7 @@ plot_bitmap(struct bitmap *bitmap, int x, int y, int width, int height)
|
|||||||
bltres = plot_alpha_bitmap(plot_hdc, bitmap, x, y, width, height);
|
bltres = plot_alpha_bitmap(plot_hdc, bitmap, x, y, width, height);
|
||||||
}
|
}
|
||||||
|
|
||||||
PLOT_LOG(("bltres = %d", bltres));
|
PLOT_LOG("bltres = %d", bltres);
|
||||||
|
|
||||||
DeleteObject(clipregion);
|
DeleteObject(clipregion);
|
||||||
|
|
||||||
@ -755,7 +755,7 @@ windows_plot_bitmap(int x, int y,
|
|||||||
|
|
||||||
/* Bail early if we can */
|
/* Bail early if we can */
|
||||||
|
|
||||||
PLOT_LOG(("Plotting %p at %d,%d by %d,%d",bitmap, x,y,width,height));
|
PLOT_LOG("Plotting %p at %d,%d by %d,%d",bitmap, x,y,width,height);
|
||||||
|
|
||||||
if (bitmap == NULL) {
|
if (bitmap == NULL) {
|
||||||
LOG("Passed null bitmap!");
|
LOG("Passed null bitmap!");
|
||||||
@ -812,8 +812,8 @@ windows_plot_bitmap(int x, int y,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
PLOT_LOG(("Tiled plotting %d,%d by %d,%d",x,y,width,height));
|
PLOT_LOG("Tiled plotting %d,%d by %d,%d",x,y,width,height);
|
||||||
PLOT_LOG(("clipped %ld,%ld to %ld,%ld",plot_clip.left, plot_clip.top, plot_clip.right, plot_clip.bottom));
|
PLOT_LOG("clipped %ld,%ld to %ld,%ld",plot_clip.left, plot_clip.top, plot_clip.right, plot_clip.bottom);
|
||||||
|
|
||||||
/* get left most tile position */
|
/* get left most tile position */
|
||||||
if (repeat_x)
|
if (repeat_x)
|
||||||
@ -823,7 +823,7 @@ windows_plot_bitmap(int x, int y,
|
|||||||
if (repeat_y)
|
if (repeat_y)
|
||||||
for (; y > plot_clip.top; y -= height);
|
for (; y > plot_clip.top; y -= height);
|
||||||
|
|
||||||
PLOT_LOG(("repeat from %d,%d to %ld,%ld", x, y, plot_clip.right, plot_clip.bottom));
|
PLOT_LOG("repeat from %d,%d to %ld,%ld", x, y, plot_clip.right, plot_clip.bottom);
|
||||||
|
|
||||||
/* tile down and across to extents */
|
/* tile down and across to extents */
|
||||||
for (xf = x; xf < plot_clip.right; xf += width) {
|
for (xf = x; xf < plot_clip.right; xf += width) {
|
||||||
@ -842,14 +842,14 @@ windows_plot_bitmap(int x, int y,
|
|||||||
|
|
||||||
static bool flush(void)
|
static bool flush(void)
|
||||||
{
|
{
|
||||||
PLOT_LOG(("flush unimplemented"));
|
PLOT_LOG("flush unimplemented");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool path(const float *p, unsigned int n, colour fill, float width,
|
static bool path(const float *p, unsigned int n, colour fill, float width,
|
||||||
colour c, const float transform[6])
|
colour c, const float transform[6])
|
||||||
{
|
{
|
||||||
PLOT_LOG(("path unimplemented"));
|
PLOT_LOG("path unimplemented");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -266,7 +266,7 @@ static BOOL CALLBACK options_appearance_dialog_handler(HWND hwnd,
|
|||||||
|
|
||||||
|
|
||||||
case WM_COMMAND:
|
case WM_COMMAND:
|
||||||
LOG(("WM_COMMAND Identifier 0x%x",LOWORD(wparam)));
|
LOG("WM_COMMAND Identifier 0x%x",LOWORD(wparam));
|
||||||
|
|
||||||
switch(LOWORD(wparam)) {
|
switch(LOWORD(wparam)) {
|
||||||
case IDC_PREFS_PROXYTYPE:
|
case IDC_PREFS_PROXYTYPE:
|
||||||
|
@ -26,9 +26,9 @@
|
|||||||
#include "windows/schedule.h"
|
#include "windows/schedule.h"
|
||||||
|
|
||||||
#ifdef DEBUG_SCHEDULER
|
#ifdef DEBUG_SCHEDULER
|
||||||
#define SRLOG(x) LOG(x)
|
#define SRLOG(x...) LOG(x)
|
||||||
#else
|
#else
|
||||||
#define SRLOG(x)
|
#define SRLOG(x...) ((void) 0)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* linked list of scheduled callbacks */
|
/* linked list of scheduled callbacks */
|
||||||
@ -66,7 +66,7 @@ static nserror schedule_remove(void (*callback)(void *p), void *p)
|
|||||||
return NSERROR_OK;
|
return NSERROR_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
SRLOG(("removing %p, %p", callback, p));
|
SRLOG("removing %p, %p", callback, p);
|
||||||
|
|
||||||
cur_nscb = schedule_list;
|
cur_nscb = schedule_list;
|
||||||
prev_nscb = NULL;
|
prev_nscb = NULL;
|
||||||
@ -76,8 +76,8 @@ static nserror schedule_remove(void (*callback)(void *p), void *p)
|
|||||||
(cur_nscb->p == p)) {
|
(cur_nscb->p == p)) {
|
||||||
/* item to remove */
|
/* item to remove */
|
||||||
|
|
||||||
SRLOG(("callback entry %p removing %p(%p)",
|
SRLOG("callback entry %p removing %p(%p)",
|
||||||
cur_nscb, cur_nscb->callback, cur_nscb->p));
|
cur_nscb, cur_nscb->callback, cur_nscb->p);
|
||||||
|
|
||||||
/* remove callback */
|
/* remove callback */
|
||||||
unlnk_nscb = cur_nscb;
|
unlnk_nscb = cur_nscb;
|
||||||
@ -118,8 +118,8 @@ nserror win32_schedule(int ival, void (*callback)(void *p), void *p)
|
|||||||
return NSERROR_NOMEM;
|
return NSERROR_NOMEM;
|
||||||
}
|
}
|
||||||
|
|
||||||
SRLOG(("adding callback %p for %p(%p) at %d cs",
|
SRLOG("adding callback %p for %p(%p) at %d cs",
|
||||||
nscb, callback, p, ival));
|
nscb, callback, p, ival);
|
||||||
|
|
||||||
gettimeofday(&nscb->tv, NULL);
|
gettimeofday(&nscb->tv, NULL);
|
||||||
timeradd(&nscb->tv, &tv, &nscb->tv);
|
timeradd(&nscb->tv, &tv, &nscb->tv);
|
||||||
@ -168,8 +168,8 @@ schedule_run(void)
|
|||||||
prev_nscb->next = unlnk_nscb->next;
|
prev_nscb->next = unlnk_nscb->next;
|
||||||
}
|
}
|
||||||
|
|
||||||
SRLOG(("callback entry %p running %p(%p)",
|
SRLOG("callback entry %p running %p(%p)",
|
||||||
unlnk_nscb, unlnk_nscb->callback, unlnk_nscb->p));
|
unlnk_nscb, unlnk_nscb->callback, unlnk_nscb->p);
|
||||||
/* call callback */
|
/* call callback */
|
||||||
unlnk_nscb->callback(unlnk_nscb->p);
|
unlnk_nscb->callback(unlnk_nscb->p);
|
||||||
|
|
||||||
@ -201,8 +201,8 @@ schedule_run(void)
|
|||||||
/* make returned time relative to now */
|
/* make returned time relative to now */
|
||||||
timersub(&nexttime, &tv, &rettime);
|
timersub(&nexttime, &tv, &rettime);
|
||||||
|
|
||||||
SRLOG(("returning time to next event as %ldms",
|
SRLOG("returning time to next event as %ldms",
|
||||||
(rettime.tv_sec * 1000) + (rettime.tv_usec / 1000)));
|
(rettime.tv_sec * 1000) + (rettime.tv_usec / 1000));
|
||||||
|
|
||||||
/* return next event time in milliseconds (24days max wait) */
|
/* return next event time in milliseconds (24days max wait) */
|
||||||
return (rettime.tv_sec * 1000) + (rettime.tv_usec / 1000);
|
return (rettime.tv_sec * 1000) + (rettime.tv_usec / 1000);
|
||||||
|
@ -29,6 +29,6 @@ void win_perror(const char *lpszFunction);
|
|||||||
((m) != WM_MOUSEMOVE) && \
|
((m) != WM_MOUSEMOVE) && \
|
||||||
((m) != WM_NCHITTEST) && \
|
((m) != WM_NCHITTEST) && \
|
||||||
((m) != WM_ENTERIDLE)) \
|
((m) != WM_ENTERIDLE)) \
|
||||||
LOG(("%s, hwnd %p, w 0x%x, l 0x%x", msg_num_to_name(m), h, w, l));
|
LOG("%s, hwnd %p, w 0x%x, l 0x%x", msg_num_to_name(m), h, w, l);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -763,7 +763,7 @@ static void nsws_set_scale(struct gui_window *gw, float scale)
|
|||||||
*/
|
*/
|
||||||
static void win32_window_redraw_window(struct gui_window *gw)
|
static void win32_window_redraw_window(struct gui_window *gw)
|
||||||
{
|
{
|
||||||
/* LOG(("gw:%p", gw)); */
|
/* LOG("gw:%p", gw); */
|
||||||
if (gw != NULL) {
|
if (gw != NULL) {
|
||||||
RedrawWindow(gw->drawingarea, NULL, NULL,
|
RedrawWindow(gw->drawingarea, NULL, NULL,
|
||||||
RDW_INVALIDATE | RDW_NOERASE);
|
RDW_INVALIDATE | RDW_NOERASE);
|
||||||
@ -794,7 +794,7 @@ void win32_window_set_scroll(struct gui_window *w, int sx, int sy)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*LOG(("scroll sx,sy:%d,%d x,y:%d,%d w.h:%d,%d",sx,sy,w->scrollx,w->scrolly, width,height));*/
|
/*LOG("scroll sx,sy:%d,%d x,y:%d,%d w.h:%d,%d",sx,sy,w->scrollx,w->scrolly, width,height);*/
|
||||||
|
|
||||||
/* The resulting gui window scroll must remain withn the
|
/* The resulting gui window scroll must remain withn the
|
||||||
* windows bounding box.
|
* windows bounding box.
|
||||||
@ -814,7 +814,7 @@ void win32_window_set_scroll(struct gui_window *w, int sx, int sy)
|
|||||||
w->requestscrolly = sy - w->scrolly;
|
w->requestscrolly = sy - w->scrolly;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*LOG(("requestscroll x,y:%d,%d", w->requestscrollx, w->requestscrolly));*/
|
/*LOG("requestscroll x,y:%d,%d", w->requestscrollx, w->requestscrolly);*/
|
||||||
|
|
||||||
/* set the vertical scroll offset */
|
/* set the vertical scroll offset */
|
||||||
si.cbSize = sizeof(si);
|
si.cbSize = sizeof(si);
|
||||||
@ -825,7 +825,7 @@ void win32_window_set_scroll(struct gui_window *w, int sx, int sy)
|
|||||||
si.nPos = max(w->scrolly + w->requestscrolly, 0);
|
si.nPos = max(w->scrolly + w->requestscrolly, 0);
|
||||||
si.nPos = min(si.nPos, height - w->height);
|
si.nPos = min(si.nPos, height - w->height);
|
||||||
SetScrollInfo(w->drawingarea, SB_VERT, &si, TRUE);
|
SetScrollInfo(w->drawingarea, SB_VERT, &si, TRUE);
|
||||||
/*LOG(("SetScrollInfo VERT min:%d max:%d page:%d pos:%d", si.nMin, si.nMax, si.nPage, si.nPos));*/
|
/*LOG("SetScrollInfo VERT min:%d max:%d page:%d pos:%d", si.nMin, si.nMax, si.nPage, si.nPos);*/
|
||||||
|
|
||||||
/* set the horizontal scroll offset */
|
/* set the horizontal scroll offset */
|
||||||
si.cbSize = sizeof(si);
|
si.cbSize = sizeof(si);
|
||||||
@ -836,7 +836,7 @@ void win32_window_set_scroll(struct gui_window *w, int sx, int sy)
|
|||||||
si.nPos = max(w->scrollx + w->requestscrollx, 0);
|
si.nPos = max(w->scrollx + w->requestscrollx, 0);
|
||||||
si.nPos = min(si.nPos, width - w->width);
|
si.nPos = min(si.nPos, width - w->width);
|
||||||
SetScrollInfo(w->drawingarea, SB_HORZ, &si, TRUE);
|
SetScrollInfo(w->drawingarea, SB_HORZ, &si, TRUE);
|
||||||
/*LOG(("SetScrollInfo HORZ min:%d max:%d page:%d pos:%d", si.nMin, si.nMax, si.nPage, si.nPos));*/
|
/*LOG("SetScrollInfo HORZ min:%d max:%d page:%d pos:%d", si.nMin, si.nMax, si.nPage, si.nPos);*/
|
||||||
|
|
||||||
/* Set caret position */
|
/* Set caret position */
|
||||||
GetCaretPos(&p);
|
GetCaretPos(&p);
|
||||||
@ -850,7 +850,7 @@ void win32_window_set_scroll(struct gui_window *w, int sx, int sy)
|
|||||||
r.left = 0;
|
r.left = 0;
|
||||||
r.right = w->width + 1;
|
r.right = w->width + 1;
|
||||||
ScrollWindowEx(w->drawingarea, - w->requestscrollx, - w->requestscrolly, &r, NULL, NULL, &redraw, SW_INVALIDATE);
|
ScrollWindowEx(w->drawingarea, - w->requestscrollx, - w->requestscrolly, &r, NULL, NULL, &redraw, SW_INVALIDATE);
|
||||||
/*LOG(("ScrollWindowEx %d, %d", - w->requestscrollx, - w->requestscrolly));*/
|
/*LOG("ScrollWindowEx %d, %d", - w->requestscrollx, - w->requestscrolly);*/
|
||||||
w->scrolly += w->requestscrolly;
|
w->scrolly += w->requestscrolly;
|
||||||
w->scrollx += w->requestscrollx;
|
w->scrollx += w->requestscrollx;
|
||||||
w->requestscrollx = 0;
|
w->requestscrollx = 0;
|
||||||
@ -1430,7 +1430,7 @@ static void win32_window_destroy(struct gui_window *w)
|
|||||||
static void
|
static void
|
||||||
win32_window_update_box(struct gui_window *gw, const struct rect *rect)
|
win32_window_update_box(struct gui_window *gw, const struct rect *rect)
|
||||||
{
|
{
|
||||||
/* LOG(("gw:%p %f,%f %f,%f", gw, data->redraw.x, data->redraw.y, data->redraw.width, data->redraw.height)); */
|
/* LOG("gw:%p %f,%f %f,%f", gw, data->redraw.x, data->redraw.y, data->redraw.width, data->redraw.height); */
|
||||||
|
|
||||||
if (gw == NULL)
|
if (gw == NULL)
|
||||||
return;
|
return;
|
||||||
|
Loading…
Reference in New Issue
Block a user