Added netsurf files

git-svn-id: svn://kolibrios.org@5043 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
ashmew2 2014-08-18 18:50:50 +00:00
parent 009c3b7c15
commit 8240a01a43
140 changed files with 11296 additions and 567 deletions

View File

@ -55,6 +55,12 @@
/* Define this to turn on verbose fetch logging */
#undef DEBUG_FETCH_VERBOSE
#ifdef DBG
#undef DBG
#endif
//#define DBG(s) __menuet__debug_out(s) /* For the debug messages in BOARD */
#define DBG(s) LOG((s)) /* So that we see debug in Netsurf's LOG files */
bool fetch_active; /**< Fetches in progress, please call fetch_poll(). */
/** Information about a fetcher for a given scheme. */
@ -514,7 +520,6 @@ void fetch_poll(void)
{
scheme_fetcher *fetcher = fetchers;
scheme_fetcher *next_fetcher;
fetch_dispatch_jobs();
if (!fetch_active)
@ -528,6 +533,7 @@ void fetch_poll(void)
}
fetcher = next_fetcher;
}
/* LOG(("Returning from fetch_poll\n")); */
}
@ -669,10 +675,9 @@ void fetch_multipart_data_destroy(struct fetch_multipart_data *list)
void
fetch_send_callback(const fetch_msg *msg, struct fetch *fetch)
{
__menuet__debug_out("Inside fetch_send_callback\n");
/* LOG(("Inside fetch_send_callback.\n")); */
fetch->callback(msg, fetch->p);
__menuet__debug_out("After fetch->callback \n");
/* LOG(("After fetch->callback \n")); */
}

File diff suppressed because it is too large Load Diff

View File

@ -28,6 +28,6 @@
void fetch_curl_register(void);
/** Global cURL multi handle. */
extern CURLM *fetch_curl_multi;
/* extern CURLM *fetch_curl_multi; */
#endif

View File

@ -27,6 +27,8 @@
#include <curl/curl.h> /* for URL unescaping functions */
#include "http.h"
#include <libwapcaplet/libwapcaplet.h>
#include "utils/config.h"
@ -202,8 +204,14 @@ static bool fetch_data_process(struct fetch_data_context *c)
* decides to nest URL and base64 encoding. Like, say, Acid2.
*/
templen = c->datalen;
unescaped = curl_easy_unescape(curl, comma + 1, 0, &templen);
c->datalen = templen;
/* TODO: Replace unescaped = line with http.obj */
/* unescaped = curl_easy_unescape(curl, comma + 1, 0, &templen); */
LOG(("Calling http_unescape_url in data.c\n"));
unescaped = http_unescape_url(comma + 1);
c->datalen = strlen(unescaped);
/* c->datalen = templen; */
if (unescaped == NULL) {
msg.type = FETCH_ERROR;
msg.data.error = "Unable to URL decode data: URL";
@ -218,7 +226,8 @@ static bool fetch_data_process(struct fetch_data_context *c)
msg.type = FETCH_ERROR;
msg.data.error = "Unable to Base64 decode data: URL";
fetch_data_send_callback(&msg, c);
curl_free(unescaped);
/* curl_free(unescaped); */
free(unescaped);
return false;
}
} else {
@ -228,13 +237,15 @@ static bool fetch_data_process(struct fetch_data_context *c)
msg.data.error =
"Unable to allocate memory for data: URL";
fetch_data_send_callback(&msg, c);
curl_free(unescaped);
/* curl_free(unescaped); */
free(unescaped);
return false;
}
memcpy(c->data, unescaped, c->datalen);
}
curl_free(unescaped);
/* curl_free(unescaped); */
free(unescaped);
return true;
}

View File

@ -168,7 +168,6 @@ fetch_file_setup(struct fetch *fetchh,
ctx->fetchh = fetchh;
RING_INSERT(ring, ctx);
return ctx;
}

View File

@ -1,5 +1,9 @@
#include <menuet/os.h>
#include "http_msg.h"
//#include "http.h"
#define NULL 0
#define __stdcall __attribute__((stdcall))
extern int dll_load();
@ -7,39 +11,16 @@ extern int mem_Free();
extern int mem_Alloc();
extern int mem_ReAlloc();
int kol_exit(){
__menuet__sys_exit();
}
struct http_msg {
// internal used by library, dont mess with these.
unsigned int socket;
unsigned int flags;
unsigned int write_ptr;
unsigned int buffer_length;
unsigned int chunk_ptr;
unsigned int timestamp;
// available for use.
unsigned int status;
unsigned int header_length;
char *content_ptr;
unsigned int content_length;
unsigned int content_received;
char header; //unknown size (actually, it's size is defined in header_length)
};
int (* __stdcall http_init)();
int (* __stdcall http_init)(void);
// On the next line, we should tell the C compiler that this procedure actually returns a pointer. (to the http_msg struct)
unsigned int (* __stdcall http_get) (char * url, char * add_head); //yay, it's NOT uint, but hey, C is stubborn, and I'm dumb
int (* __stdcall http_process) (unsigned int identifier);
int (* __stdcall http_receive) (unsigned int identifier);
void (* __stdcall http_free) (unsigned int identifier);
char * (* __stdcall http_find_header_field) (struct http_msg *http_ahoy, char *field_name); //This is crazzzzzzyyyyyy
char * (* __stdcall http_unescape_url) (char * url_asciiz);
char * (* __stdcall http_post) (char *url, char *headers, char *content_type, int content_length);
int (* __stdcall http_send) (struct http_msg *handle, char *data, unsigned int length);
void (* __stdcall http_disconnect) (struct http_msg *handle);
int HTTP_YAY(){
asm volatile ("pusha\n\
@ -52,11 +33,14 @@ int HTTP_YAY(){
popa");
}
///===========================
int kol_exit(){
__menuet__debug_out("kol_exit()..Exiting..\n");
__menuet__sys_exit();
}
void HTTP_INIT()
{
IMP_ENTRY *imp;
const IMP_ENTRY *imp;
imp = __kolibri__cofflib_load("/sys/lib/http.obj");
if (imp == NULL)
@ -65,27 +49,87 @@ if (imp == NULL)
http_init = ( __stdcall int(*)())
__kolibri__cofflib_getproc (imp, "lib_init");
if (http_init == NULL)
{
__menuet__debug_out("http_init() is NULL. Exiting.\n");
kol_exit();
}
else
__menuet__debug_out("\nhttp_init() initialised properly.\n");
http_get = ( __stdcall unsigned int (*)(char*))
http_get = ( __stdcall unsigned int (*)(char*, char*))
__kolibri__cofflib_getproc (imp, "get");
if (http_get == NULL)
{
__menuet__debug_out("http_get() is NULL. Exiting.\n");
kol_exit();
}
http_free = ( __stdcall void (*)(unsigned int))
__kolibri__cofflib_getproc (imp, "free");
if (http_free == NULL)
{
__menuet__debug_out("http_free() is NULL. Exiting.\n");
kol_exit();
}
http_receive = ( __stdcall int (*)(unsigned int))
__kolibri__cofflib_getproc (imp, "receive");
if (http_receive == NULL)
{
__menuet__debug_out("http_receive() is NULL. Exiting.\n");
kol_exit();
}
http_find_header_field = ( __stdcall char *(*)(struct http_msg*, char *))
__kolibri__cofflib_getproc (imp, "find_header_field");
if (http_find_header_field == NULL)
{
__menuet__debug_out("http_find_header_field() is NULL. Exiting.\n");
kol_exit();
}
http_unescape_url = ( __stdcall char *(*)(char *))
__kolibri__cofflib_getproc (imp, "unescape");
if(http_unescape_url == NULL)
{
__menuet__debug_out("http_unescape_url() is NULL. Exiting.\n");
kol_exit();
}
http_post = ( __stdcall char *(*)(char *, char *, char *, int))
__kolibri__cofflib_getproc (imp, "post");
if(http_post == NULL)
{
__menuet__debug_out("http_post() is NULL. Exiting.\n");
kol_exit();
}
http_process = ( __stdcall int (*)(unsigned int))
__kolibri__cofflib_getproc (imp, "process");
if (http_process == NULL)
http_send = ( __stdcall int (*)(struct http_msg *, char *, unsigned int))
__kolibri__cofflib_getproc (imp, "send");
if(http_send == NULL)
{
__menuet__debug_out("http_send() is NULL. Exiting.\n");
kol_exit();
}
http_disconnect = ( __stdcall void (*)(struct http_msg *))
__kolibri__cofflib_getproc (imp, "disconnect");
if(http_disconnect == NULL)
{
__menuet__debug_out("http_disconnect() is NULL. Exiting.\n");
kol_exit();
}
__menuet__debug_out("HTTP init...\n");
HTTP_YAY();
__menuet__debug_out("ok...\n");
}

View File

@ -13,7 +13,7 @@ NETSURF_FRAMEBUFFER_BIN := $(PREFIX)/bin/
# freetype compiled in font serch path
NETSURF_FB_FONTPATH := /usr/share/fonts/truetype/ttf-dejavu:/usr/share/fonts/truetype/msttcorefonts
OBJS := curl.o data.o file.o about.o resource.o
OBJS := curl.o data.o file.o about.o resource.o http.o
OUTFILE = TEST.o
CFLAGS += -I ../include/ -I ../ -I../../ -I./ -I/home/sourcerer/kos_src/newenginek/kolibri/include -I ../../../libwapcaplet/include/ -I ../../../libcss/include/

View File

@ -220,7 +220,6 @@ void hlcache_finalise(void)
/* See hlcache.h for documentation */
nserror hlcache_poll(void)
{
llcache_poll();
return NSERROR_OK;
@ -515,11 +514,13 @@ nserror hlcache_llcache_callback(llcache_handle *handle,
hlcache_retrieval_ctx *ctx = pw;
lwc_string *effective_type = NULL;
nserror error;
/* LOG(("Asserting ctx->llcache == handle")); */
assert(ctx->llcache == handle);
/* LOG(("After Asserting ctx->llcache == handle")); */
switch (event->type) {
case LLCACHE_EVENT_HAD_HEADERS:
/* LOG(("LLCACHE_EVENT_HAD_HEADERS")); */
error = mimesniff_compute_effective_type(handle, NULL, 0,
ctx->flags & HLCACHE_RETRIEVE_SNIFF_TYPE,
ctx->accepted_types == CONTENT_IMAGE,
@ -528,6 +529,7 @@ nserror hlcache_llcache_callback(llcache_handle *handle,
/* If the sniffer was successful or failed to find
* a Content-Type header when sniffing was
* prohibited, we must migrate the retrieval context. */
/* LOG(("hlcache_migraet_ctx from LLCACHE_HAD_HEADERS")); */
error = hlcache_migrate_ctx(ctx, effective_type);
if (effective_type != NULL)
@ -543,6 +545,7 @@ nserror hlcache_llcache_callback(llcache_handle *handle,
break;
case LLCACHE_EVENT_HAD_DATA:
/* LOG(("LLCACHE_EVENT_HAD_DATA")); */
error = mimesniff_compute_effective_type(handle,
event->data.data.buf, event->data.data.len,
ctx->flags & HLCACHE_RETRIEVE_SNIFF_TYPE,
@ -551,7 +554,7 @@ nserror hlcache_llcache_callback(llcache_handle *handle,
if (error != NSERROR_OK) {
assert(0 && "MIME sniff failed with data");
}
/* LOG(("hlcache_migraet_ctx from LLCACHE_HAD_DATA")); */
error = hlcache_migrate_ctx(ctx, effective_type);
lwc_string_unref(effective_type);
@ -560,11 +563,13 @@ nserror hlcache_llcache_callback(llcache_handle *handle,
break;
case LLCACHE_EVENT_DONE:
/* LOG(("LLCACHE_EVENT_DONE")); */
/* DONE event before we could determine the effective MIME type.
*/
error = mimesniff_compute_effective_type(handle,
NULL, 0, false, false, &effective_type);
if (error == NSERROR_OK) {
/* LOG(("hlcache_migrate_ctx in LLCACHE_EVENT_DONE")); */
error = hlcache_migrate_ctx(ctx, effective_type);
lwc_string_unref(effective_type);
@ -577,11 +582,11 @@ nserror hlcache_llcache_callback(llcache_handle *handle,
hlevent.type = CONTENT_MSG_ERROR;
hlevent.data.error = messages_get("BadType");
ctx->handle->cb(ctx->handle, &hlevent, ctx->handle->pw);
}
break;
case LLCACHE_EVENT_ERROR:
/* LOG(("LLCACHE_EVENT_ERROR")); */
if (ctx->handle->cb != NULL) {
hlcache_event hlevent;
@ -592,9 +597,10 @@ nserror hlcache_llcache_callback(llcache_handle *handle,
}
break;
case LLCACHE_EVENT_PROGRESS:
/* LOG(("LLCACHE_EVENT_PROGRESS")); */
break;
}
/* LOG(("Returning OK from hlcache_llcache_callback")); */
return NSERROR_OK;
}
@ -654,7 +660,7 @@ nserror hlcache_migrate_ctx(hlcache_retrieval_ctx *ctx,
/* Unacceptable type: report error */
if (ctx->handle->cb != NULL) {
hlcache_event hlevent;
/* LOG(("Unacceptable Type! CONTENT_MSG_ERROR set")); */
hlevent.type = CONTENT_MSG_ERROR;
hlevent.data.error = messages_get("UnacceptableType");
@ -814,13 +820,14 @@ nserror hlcache_find_content(hlcache_retrieval_ctx *ctx,
}
if (ctx->handle->cb != NULL) {
/* LOG(("Calling with CONTENT_MSG_DONE")); */
event.type = CONTENT_MSG_DONE;
ctx->handle->cb(ctx->handle, &event,
ctx->handle->pw);
}
}
}
/* LOG(("Returning from ")); */
return error;
}

View File

@ -37,6 +37,13 @@
/** Define to enable tracing of llcache operations. */
#undef LLCACHE_TRACE
#ifdef DBG
#undef DBG
#endif
//#define DBG(s) __menuet__debug_out(s) /* For the debug messages in BOARD */
#define DBG(s) LOG((s)) /* So that we see debug in Netsurf's LOG files */
/** State of a low-level cache object fetch */
typedef enum {
LLCACHE_FETCH_INIT, /**< Initial state, before fetch */
@ -486,14 +493,17 @@ static nserror llcache_fetch_parse_header(llcache_object *object,
if (5 < len && strcasecmp(*name, "Date") == 0) {
/* extract Date header */
object->cache.date = curl_getdate(*value, NULL);
/* TODO: object->cache.date = curl_getdate(*value, NULL); */
object->cache.date = (time_t) 12341234;
} else if (4 < len && strcasecmp(*name, "Age") == 0) {
/* extract Age header */
if ('0' <= **value && **value <= '9')
object->cache.age = atoi(*value);
} else if (8 < len && strcasecmp(*name, "Expires") == 0) {
/* extract Expires header */
object->cache.expires = curl_getdate(*value, NULL);
/* TODO: object->cache.expires = curl_getdate(*value, NULL); */
object->cache.expires = (time_t) 123412399;
} else if (14 < len && strcasecmp(*name, "Cache-Control") == 0) {
/* extract and parse Cache-Control header */
const char *start = *value;
@ -543,7 +553,8 @@ static nserror llcache_fetch_parse_header(llcache_object *object,
return NSERROR_NOMEM;
} else if (14 < len && strcasecmp(*name, "Last-Modified") == 0) {
/* extract Last-Modified header */
object->cache.last_modified = curl_getdate(*value, NULL);
/* TODO object->cache.last_modified = curl_getdate(*value, NULL); */
object->cache.last_modified = (time_t) 12341230;
}
#undef SKIP_ST
@ -1623,14 +1634,17 @@ static void llcache_fetch_callback(const fetch_msg *msg, void *p)
nserror error = NSERROR_OK;
llcache_object *object = p;
llcache_event event;
__menuet__debug_out("Inside llcache_fetch_callback\n");
/* DBG("Inside llcache_fetch_callback\n"); */
#ifdef LLCACHE_TRACE
LOG(("Fetch event %d for %p", msg->type, object));
#endif
if(!msg)
LOG(("msg is NULL in llcache_fetch_callback\n"));
switch (msg->type) {
case FETCH_HEADER:
/* DBG("FETCH_HEADER in llcache\n"); */
/* Received a fetch header */
object->fetch.state = LLCACHE_FETCH_HEADERS;
@ -1642,7 +1656,7 @@ static void llcache_fetch_callback(const fetch_msg *msg, void *p)
/* 3xx responses */
case FETCH_REDIRECT:
/* Request resulted in a redirect */
/* DBG("FETCH_REDIRECT in llcache\n"); */
/* Release candidate, if any */
if (object->candidate != NULL) {
object->candidate->candidate_count--;
@ -1654,11 +1668,13 @@ static void llcache_fetch_callback(const fetch_msg *msg, void *p)
break;
case FETCH_NOTMODIFIED:
/* Conditional request determined that cached object is fresh */
/* DBG("FETCH_NOTMODIFIED in llcache\n"); */
error = llcache_fetch_notmodified(object, &object);
break;
/* Normal 2xx state machine */
case FETCH_DATA:
/* DBG("FETCH_DATA in llcache\n"); */
/* Received some data */
if (object->fetch.state != LLCACHE_FETCH_DATA) {
/* On entry into this state, check if we need to
@ -1701,6 +1717,7 @@ static void llcache_fetch_callback(const fetch_msg *msg, void *p)
{
uint8_t *temp;
/* DBG("FETCH_FINISHED in llcache\n"); */
object->fetch.state = LLCACHE_FETCH_COMPLETE;
object->fetch.fetch = NULL;
@ -1721,6 +1738,7 @@ static void llcache_fetch_callback(const fetch_msg *msg, void *p)
case FETCH_ERROR:
/* An error occurred while fetching */
/* The fetch has has already been cleaned up by the fetcher */
/* DBG("FETCH_ERROR in llcache\n"); */
object->fetch.state = LLCACHE_FETCH_COMPLETE;
object->fetch.fetch = NULL;
@ -1742,6 +1760,7 @@ static void llcache_fetch_callback(const fetch_msg *msg, void *p)
break;
case FETCH_PROGRESS:
/* DBG("FETCH_PROGRESS in llcache\n"); */
/* Progress update */
event.type = LLCACHE_EVENT_PROGRESS;
event.data.msg = msg->data.progress;
@ -1752,6 +1771,7 @@ static void llcache_fetch_callback(const fetch_msg *msg, void *p)
/* Events requiring action */
case FETCH_AUTH:
/* DBG("FETCH_AUTH\n"); */
/* Need Authentication */
/* Release candidate, if any */
@ -1764,7 +1784,7 @@ static void llcache_fetch_callback(const fetch_msg *msg, void *p)
break;
case FETCH_CERT_ERR:
/* Something went wrong when validating TLS certificates */
/* DBG("FETCH_CERT_ERR\n"); */
/* Release candidate, if any */
if (object->candidate != NULL) {
object->candidate->candidate_count--;
@ -1777,7 +1797,7 @@ static void llcache_fetch_callback(const fetch_msg *msg, void *p)
break;
case FETCH_SSL_ERR:
/* TLS connection setup failed */
/* DBG("FETCH_SSL_ERR\n"); */
/* Release candidate, if any */
if (object->candidate != NULL) {
object->candidate->candidate_count--;
@ -1790,6 +1810,7 @@ static void llcache_fetch_callback(const fetch_msg *msg, void *p)
/* Deal with any errors reported by event handlers */
if (error != NSERROR_OK) {
/* DBG("Error is not NSERROR_OK!\n"); */
if (object->fetch.fetch != NULL) {
fetch_abort(object->fetch.fetch);
object->fetch.fetch = NULL;
@ -1799,10 +1820,10 @@ static void llcache_fetch_callback(const fetch_msg *msg, void *p)
object->fetch.state = LLCACHE_FETCH_COMPLETE;
}
__menuet__debug_out("Returning from llcache_fetch_callback. (err != NS_OK)\n");
/* DBG("Returning llc_f_cb. (err != NS_OK)\n"); */
return;
}
__menuet__debug_out("Returning from llcache_fetch_callback.(err = NS_OK)\n");
/* DBG("Returning from llc_f_cb.(err = NS_OK)\n"); */
}
/**
@ -2352,7 +2373,6 @@ void llcache_finalise(void)
nserror llcache_poll(void)
{
llcache_object *object;
fetch_poll();
/* Catch new users up with state of objects */

View File

@ -3268,7 +3268,9 @@ bool urldb_parse_avpair(struct cookie_internal_data *c, char *n, char *v,
datenoday++)
; /* do nothing */
expires = curl_getdate(datenoday, NULL);
/* TODO: expires = curl_getdate(datenoday, NULL); */
expires = (time_t) 100123123;
if (expires == -1) {
/* assume we have an unrepresentable
* date => force it to the maximum

View File

@ -17,5 +17,5 @@ OBJS := css.o dump.o internal.o select.o utils.o
OUTFILE = TEST.o
CFLAGS += -I ../include/ -I ../ -I../../ -I./ -I/home/sourcerer/kos_src/newenginek/kolibri/include
CFLAGS += -I ../include/ -I ../ -I../../ -I./ -I/home/sourcerer/kos_src/newenginek/kolibri/include -I ../../libwapcaplet/include/ -I ../../libdom/include/ -I ../../libcss/include/ -I ../../libhubbub/include/
include $(MENUETDEV)/makefiles/Makefile_for_o_lib

View File

@ -341,7 +341,7 @@ css_error nscss_compute_font_size(void *pw, const css_hint *parent,
parent_size = parent->data.length;
}
assert(size->status != CSS_FONT_SIZE_INHERIT);
/* assert(size->status != CSS_FONT_SIZE_INHERIT); */
if (size->status < CSS_FONT_SIZE_LARGER) {
/* Keyword -- simple */

View File

@ -73,7 +73,7 @@ css_fixed nscss_len2pt(css_fixed length, css_unit unit)
css_fixed nscss_len2px(css_fixed length, css_unit unit,
const css_computed_style *style)
{
/* We assume the screen and any other output has the same dpi */
/* We assume the screen and ay other output has the same dpi */
css_fixed px_per_unit;
assert(style != NULL || (unit != CSS_UNIT_EM && unit != CSS_UNIT_EX));

View File

@ -18,5 +18,6 @@ OBJS := browser.o download.o frames.o history_core.o netsurf.o \
OUTFILE = TEST.o
CFLAGS += -I ../include/ -I ../ -I../../ -I./ -I/home/sourcerer/kos_src/newenginek/kolibri/include
CFLAGS += -I ../include/ -I ../ -I../../ -I./ -I/home/sourcerer/kos_src/newenginek/kolibri/include -I ../../libwapcaplet/include/ -I ../../libcss/include/ -I ../../libdom/include/ -I ../../libhubbub/include/
include $(MENUETDEV)/makefiles/Makefile_for_o_lib

View File

@ -20,5 +20,6 @@ OBJS := cookies.o history_global_core.o hotlist.o knockout.o \
OUTFILE = TEST.o
CFLAGS += -I ../include/ -I ../ -I../../ -I./ -I/home/sourcerer/kos_src/newenginek/kolibri/include
CFLAGS += -I ../include/ -I ../ -I../../ -I./ -I/home/sourcerer/kos_src/newenginek/kolibri/include -I ../../libwapcaplet/include/ -I../../libcss/include -I ../../libdom/include/ -I ../../libhubbub/include/ -I ../../include/
include $(MENUETDEV)/makefiles/Makefile_for_o_lib

View File

@ -236,6 +236,7 @@ nserror netsurf_init(int *pargc,
js_initialise();
LOG(("Returning from netsurf_init()"));
return ret;
}
@ -246,12 +247,13 @@ nserror netsurf_init(int *pargc,
int netsurf_main_loop(void)
{
while (!netsurf_quit) {
LOG(("GUI POLL"));
/* LOG(("GUI POLL")); */
gui_poll(fetch_active);
LOG(("CACHE POLL"));
/* LOG(("CACHE POLL")); */
hlcache_poll();
}
fflush(stdout);
fflush(stderr);
return 0;
}

View File

@ -35,60 +35,67 @@
#include "widget.h"
#ifdef DBG
#undef DBG
#endif
//#define DBG(s) __menuet__debug_out(s) /* For the debug messages in BOARD */
#define DBG(s) LOG((s)) /* So that we see debug in Netsurf's LOG files */
static int
fb_redraw_bitmap(fbtk_widget_t *widget, fbtk_callback_info *cbi)
{
LOG(("REDRAW BITMAP"));
//__menuet__debug_out("REDRAW BITMAP");
/* LOG(("REDRAW BITMAP")); */
//DBG("REDRAW BITMAP");
nsfb_bbox_t bbox;
nsfb_bbox_t rect;
nsfb_t *nsfb;
LOG(("REDRAW BITMAP 1 "));
//__menuet__debug_out("REDRAW BITMAP 1");
/* LOG(("REDRAW BITMAP 1 ")); */
//DBG("REDRAW BITMAP 1");
nsfb = fbtk_get_nsfb(widget);
LOG(("REDRAW BITMAP 2"));
//__menuet__debug_out("REDRAW BITMAP 2");
/* LOG(("REDRAW BITMAP 2")); */
//DBG("REDRAW BITMAP 2");
fbtk_get_bbox(widget, &bbox);
rect = bbox;
LOG(("REDRAW BITMAP 3 "));
//__menuet__debug_out("REDRAW BITMAP 3");
/* LOG(("REDRAW BITMAP 3 ")); */
//DBG("REDRAW BITMAP 3");
nsfb_claim(nsfb, &bbox);
LOG(("REDRAW BITMAP 4"));
//__menuet__debug_out("REDRAW BITMAP 4");
/* LOG(("REDRAW BITMAP 4")); */
//DBG("REDRAW BITMAP 4");
/* clear background */
if ((widget->bg & 0xFF000000) != 0) {
/* transparent polygon filling isnt working so fake it */
LOG(("REDRAW BITMAP 5"));
//__menuet__debug_out("REDRAW BITMAP 5");
/* LOG(("REDRAW BITMAP 5")); */
//DBG("REDRAW BITMAP 5");
nsfb_plot_rectangle_fill(nsfb, &bbox, widget->bg);
}
LOG(("REDRAW BITMAP 6"));
//__menuet__debug_out("REDRAW BITMAP 6\n");
/* LOG(("REDRAW BITMAP 6")); */
//DBG("REDRAW BITMAP 6\n");
/* plot the image */
LOG(("STUB: DON'T REAL DRAW"));
//__menuet__debug_out("STUB: DON'T REAL DRAW\n");
/* LOG(("STUB: DON'T REAL DRAW")); */
//DBG("STUB: DON'T REAL DRAW\n");
LOG(("pixdata is %x", (nsfb_colour_t *)widget->u.bitmap.bitmap->pixdata));
LOG(("pixdata is w:%d h:%d",widget->u.bitmap.bitmap->width,
widget->u.bitmap.bitmap->height));
/* LOG(("pixdata is %x", (nsfb_colour_t *)widget->u.bitmap.bitmap->pixdata)); */
/* LOG(("pixdata is w:%d h:%d",widget->u.bitmap.bitmap->width, */
/* widget->u.bitmap.bitmap->height)); */
//hmm
@ -112,13 +119,13 @@ fb_redraw_bitmap(fbtk_widget_t *widget, fbtk_callback_info *cbi)
LOG(("REDRAW BITMAP 7"));
//__menuet__debug_out("REDRAW BITMAP 7\n");
/* LOG(("REDRAW BITMAP 7")); */
//DBG("REDRAW BITMAP 7\n");
nsfb_update(nsfb, &bbox);
LOG(("REDRAW BITMAP OK\n"));
//__menuet__debug_out("REDRAW BITMAP OK\n");
/* LOG(("REDRAW BITMAP OK\n")); */
//DBG("REDRAW BITMAP OK\n");
return 0;
}
@ -127,8 +134,8 @@ fb_redraw_bitmap(fbtk_widget_t *widget, fbtk_callback_info *cbi)
void
fbtk_set_bitmap(fbtk_widget_t *widget, struct fbtk_bitmap *image)
{
LOG(("SET BITMAP"));
//__menuet__debug_out("set BITMAP");
/* LOG(("SET BITMAP")); */
//DBG("set BITMAP");
if ((widget == NULL) || (widget->type != FB_WIDGET_TYPE_BITMAP))
return;
@ -147,8 +154,8 @@ fbtk_create_bitmap(fbtk_widget_t *parent,
colour c,
struct fbtk_bitmap *image)
{
LOG(("CREATE BITMAP"));
//__menuet__debug_out("cr BITMAP");
/* LOG(("CREATE BITMAP")); */
//DBG("cr BITMAP");
fbtk_widget_t *neww;
neww = fbtk_widget_new(parent, FB_WIDGET_TYPE_BITMAP, x, y, width, height);
@ -176,8 +183,8 @@ fbtk_create_button(fbtk_widget_t *parent,
{
fbtk_widget_t *neww;
LOG(("CREATE BUTTON BITMAP"));
//__menuet__debug_out("cr bb BITMAP");
/* LOG(("CREATE BUTTON BITMAP")); */
//DBG("cr bb BITMAP");
neww = fbtk_widget_new(parent, FB_WIDGET_TYPE_BITMAP, x, y, width, height);
neww->bg = c;

View File

@ -43,6 +43,13 @@
#include "widget.h"
#ifdef DBG
#undef DBG
#endif
//#define DBG(s) __menuet__debug_out(s) /* For the debug messages in BOARD */
#define DBG(s) LOG((s)) /* So that we see debug in Netsurf's LOG files */
#ifdef FBTK_LOGGING
/* tree dump debug, also example of depth first tree walk */
@ -53,7 +60,7 @@ dump_tk_tree(fbtk_widget_t *widget)
int indent = 0;
while (widget != NULL) {
LOG(("%*s%p", indent, "", widget));
/* LOG(("%*s%p", indent, "", widget)); */
if (widget->first_child != NULL) {
widget = widget->first_child;
indent += 6;
@ -100,12 +107,12 @@ fbtk_request_redraw(fbtk_widget_t *widget)
widget->redraw.width = widget->width;
widget->redraw.height = widget->height;
LOG(("redrawing %p %d,%d %d,%d",
widget,
widget->redraw.x,
widget->redraw.y,
widget->redraw.width,
widget->redraw.height));
/* LOG(("redrawing %p %d,%d %d,%d", */
/* widget, */
/* widget->redraw.x, */
/* widget->redraw.y, */
/* widget->redraw.width, */
/* widget->redraw.height)); */
cwidget = widget->last_child;
while (cwidget != NULL) {
@ -125,7 +132,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));
/* LOG(("setting mapping on %p to %d", widget, map)); */
widget->mapped = map;
if (map) {
fbtk_request_redraw(widget);
@ -147,7 +154,7 @@ swap_siblings(fbtk_widget_t *lw)
fbtk_widget_t *after;
rw = lw->next;
LOG(("Swapping %p with %p", lw, rw));
/* LOG(("Swapping %p with %p", lw, rw)); */
before = lw->prev;
after = rw->next;
@ -394,7 +401,7 @@ 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!"));
/* LOG(("Widget with null parent that is not the root widget!")); */
return NULL;
}
@ -525,21 +532,21 @@ fbtk_widget_new(fbtk_widget_t *parent,
int width,
int height)
{
LOG(("New widget..."));
/* LOG(("New widget...")); */
fbtk_widget_t *neww; /* new widget */
if (parent == NULL)
{LOG(("parent null..."));
{/* LOG(("parent null...")); */
return NULL;}
LOG(("calloc..."));
/* LOG(("calloc...")); */
neww = calloc(1, sizeof(fbtk_widget_t));
if (neww == NULL)
return NULL;
LOG(("super!..."));
LOG(("creating %p %d,%d %d,%d", neww, x, y, width, height));
/* LOG(("super!...")); */
/* LOG(("creating %p %d,%d %d,%d", neww, x, y, width, height)); */
/* make new window fit inside parent */
if (width == 0) {
@ -561,7 +568,7 @@ fbtk_widget_new(fbtk_widget_t *parent,
}
LOG(("using %p %d,%d %d,%d", neww, x, y, width, height));
/* LOG(("using %p %d,%d %d,%d", neww, x, y, width, height)); */
/* set values */
neww->type = type;
neww->x = x;
@ -571,23 +578,23 @@ fbtk_widget_new(fbtk_widget_t *parent,
/* insert into widget heiarchy */
LOG(("into hierarchy..."));
/* LOG(("into hierarchy...")); */
neww->parent = parent;
if (parent->first_child == NULL) {
/* no child widgets yet */
LOG(("no childs yet..."));
/* LOG(("no childs yet...")); */
parent->last_child = neww;
} else {
/* add new widget to front of sibling chain */
neww->next = parent->first_child;
neww->next->prev = neww;
LOG(("n front of sibling..."));
/* LOG(("n front of sibling...")); */
}
parent->first_child = neww;
LOG(("Widget OK..."));
/* LOG(("Widget OK...")); */
return neww;
}
@ -620,8 +627,8 @@ do_redraw(nsfb_t *nsfb, fbtk_widget_t *widget)
fbtk_widget_t *cwidget; /* child widget */
LOG(("DO REDRAW"));
//__menuet__debug_out("\n***********\nDO REDRAW\n********\n");
/* LOG(("DO REDRAW")); */
//DBG("\n***********\nDO REDRAW\n********\n");
/* check if the widget requires redrawing */
if (widget->redraw.needed == true) {
plot_ctx.x0 = fbtk_get_absx(widget) + widget->redraw.x;
@ -629,13 +636,13 @@ do_redraw(nsfb_t *nsfb, fbtk_widget_t *widget)
plot_ctx.x1 = plot_ctx.x0 + widget->redraw.width;
plot_ctx.y1 = plot_ctx.y0 + widget->redraw.height;
LOG(("clipping %p %d,%d %d,%d",
widget, plot_ctx.x0, plot_ctx.y0,
plot_ctx.x1, plot_ctx.y1));
/* LOG(("clipping %p %d,%d %d,%d", */
/* widget, plot_ctx.x0, plot_ctx.y0, */
/* plot_ctx.x1, plot_ctx.y1)); */
if (nsfb_plot_set_clip(nsfb, &plot_ctx) == true) {
LOG(("POST CALLBACK"));
//__menuet__debug_out("\n***********\nPOST CALLBACK\n********\n");
/* LOG(("POST CALLBACK")); */
//DBG("\n***********\nPOST CALLBACK\n********\n");
fbtk_post_callback(widget, FBTK_CBT_REDRAW);
}
@ -643,28 +650,28 @@ do_redraw(nsfb_t *nsfb, fbtk_widget_t *widget)
}
LOG(("DO CHILD"));
//__menuet__debug_out("\n***********\nDO CHILD\n********\n");
/* LOG(("DO CHILD")); */
//DBG("\n***********\nDO CHILD\n********\n");
/* walk the widgets children if child flag is set */
if (widget->redraw.child) {
LOG(("DO CHILD 2"));
//__menuet__debug_out("\n***********\nDO CHILD 2\n********\n");
/* LOG(("DO CHILD 2")); */
//DBG("\n***********\nDO CHILD 2\n********\n");
cwidget = widget->last_child;
while (cwidget != NULL) {
LOG(("DO CHILD 3 ZZZ"));
//__menuet__debug_out("\n***********\nDO CHILD 3 ZZZ\n********\n");
/* LOG(("DO CHILD 3 ZZZ")); */
//DBG("\n***********\nDO CHILD 3 ZZZ\n********\n");
do_redraw(nsfb, cwidget);
cwidget = cwidget->prev;
}
LOG(("DO CHILD 4"));
//__menuet__debug_out("\n***********\nDO CHILD 4\n********\n");
/* LOG(("DO CHILD 4")); */
//DBG("\n***********\nDO CHILD 4\n********\n");
widget->redraw.child = false;
}
LOG(("SUP"));
//__menuet__debug_out("\n***********\nFIN REDRAW\n********\n");
/* LOG(("SUP")); */
//DBG("\n***********\nFIN REDRAW\n********\n");
return 1;
}
@ -720,8 +727,8 @@ int
fbtk_post_callback(fbtk_widget_t *widget, fbtk_callback_type cbt, ...)
{
LOG(("DO POST CALLBACK"));
//__menuet__debug_out("\n***********\nDO POST CALLBACK\n********\n");
/* LOG(("DO POST CALLBACK")); */
//DBG("\n***********\nDO POST CALLBACK\n********\n");
fbtk_callback_info cbi;
int ret = 0;
@ -735,84 +742,84 @@ fbtk_post_callback(fbtk_widget_t *widget, fbtk_callback_type cbt, ...)
if (widget->mapped == false)
return ret;
LOG(("DO POST CALLBACK 2"));
//__menuet__debug_out("\n***********\nDO POST CALLBACK 2\n********\n");
/* LOG(("DO POST CALLBACK 2")); */
//DBG("\n***********\nDO POST CALLBACK 2\n********\n");
if (widget->callback[cbt] != NULL) {
cbi.type = cbt;
cbi.context = widget->callback_context[cbt];
LOG(("DO POST CALLBACK 3 - VA"));
//__menuet__debug_out("\n***********\nDO POST CALLBACK 3 - VA\n********\n");
/* LOG(("DO POST CALLBACK 3 - VA")); */
//DBG("\n***********\nDO POST CALLBACK 3 - VA\n********\n");
va_start(ap, cbt);
switch (cbt) {
case FBTK_CBT_SCROLLX:
//__menuet__debug_out("\n***********\n scroll x - VA\n********\n");
//DBG("\n***********\n scroll x - VA\n********\n");
cbi.x = va_arg(ap,int);
break;
case FBTK_CBT_SCROLLY:
//__menuet__debug_out("\n***********\n scroll y - VA\n********\n");
//DBG("\n***********\n scroll y - VA\n********\n");
cbi.y = va_arg(ap,int);
break;
case FBTK_CBT_CLICK:
//__menuet__debug_out("\n***********\n click - VA\n********\n");
//DBG("\n***********\n click - VA\n********\n");
cbi.event = va_arg(ap, void *);
cbi.x = va_arg(ap, int);
cbi.y = va_arg(ap, int);
break;
case FBTK_CBT_INPUT:
//__menuet__debug_out("\n***********\n input - VA\n********\n");
//DBG("\n***********\n input - VA\n********\n");
cbi.event = va_arg(ap, void *);
break;
case FBTK_CBT_POINTERMOVE:
//__menuet__debug_out("\n***********\n mouse move - VA\n********\n");
//DBG("\n***********\n mouse move - VA\n********\n");
cbi.x = va_arg(ap, int);
cbi.y = va_arg(ap, int);
break;
case FBTK_CBT_REDRAW:
//__menuet__debug_out("\n***********\n red - VA\n********\n");
//DBG("\n***********\n red - VA\n********\n");
break;
case FBTK_CBT_USER:
//__menuet__debug_out("\n***********\n user - VA\n********\n");
//DBG("\n***********\n user - VA\n********\n");
break;
case FBTK_CBT_STRIP_FOCUS:
//__menuet__debug_out("\n***********\n focus - VA\n********\n");
//DBG("\n***********\n focus - VA\n********\n");
break;
default:
//__menuet__debug_out("\n***********\n wtf - VA\n********\n");
//DBG("\n***********\n wtf - VA\n********\n");
break;
}
LOG(("DO POST CALLBACK free"));
//__menuet__debug_out("\n***********\nDO POST CALLBACK free\n********\n");
/* LOG(("DO POST CALLBACK free")); */
//DBG("\n***********\nDO POST CALLBACK free\n********\n");
va_end(ap);
LOG(("DO CALLBACK YEAH"));
//__menuet__debug_out("\n***********\nWTF IS THIS\n********\n");
/* LOG(("DO CALLBACK YEAH")); */
//DBG("\n***********\nWTF IS THIS\n********\n");
char zupa[64];
sprintf (zupa, "ADDRESS of callback is %x \n",(widget->callback[cbt]));
//__menuet__debug_out(zupa);
LOG(("ADDRESS of callback is %x \n",(widget->callback[cbt])));
//DBG(zupa);
/* LOG(("ADDRESS of callback is %x \n",(widget->callback[cbt]))); */
ret = (widget->callback[cbt])(widget, &cbi);
LOG(("DO CALLBACK YEAH 2"));
//__menuet__debug_out("\n***********\nWTF IS THIS!!!12121\n********\n");
/* LOG(("DO CALLBACK YEAH 2")); */
//DBG("\n***********\nWTF IS THIS!!!12121\n********\n");
}
LOG(("DO POST CALLBACK OK"));
//__menuet__debug_out("\n***********\nDO POST CALLBACK OK\n********\n");
/* LOG(("DO POST CALLBACK OK")); */
//DBG("\n***********\nDO POST CALLBACK OK\n********\n");
return ret;
}

View File

@ -2,6 +2,6 @@ OBJS = fbtk.o event.o fill.o bitmap.o user.o window.o \
text.o scroll.o osk.o
OUTFILE = TEST.o
CFLAGS += -I ../include/ -I ../ -I../../ -I./ -I/home/sourcerer/kos_src/newenginek/kolibri/include
CFLAGS += -I ../include/ -I ../ -I../../ -I./ -I/home/sourcerer/kos_src/newenginek/kolibri/include -I../../../libnsfb/include/ -I ../../../libcss/include/ -I ../../../libwapcaplet/include/
include $(MENUETDEV)/makefiles/Makefile_for_o_lib

View File

@ -40,13 +40,19 @@
#include "widget.h"
#ifdef DBG
#undef DBG
#endif
//#define DBG(s) __menuet__debug_out(s) /* For the debug messages in BOARD */
#define DBG(s) LOG((s)) /* So that we see debug in Netsurf's LOG files */
/* Vertical scroll widget */
static int
vscroll_redraw(fbtk_widget_t *widget, fbtk_callback_info *cbi)
{
LOG(("REDRAW SCROLL"));
//__menuet__debug_out("REDRAW SCROLL");
//DBG("REDRAW SCROLL");
int vscroll;
int vpos;
@ -54,16 +60,16 @@ vscroll_redraw(fbtk_widget_t *widget, fbtk_callback_info *cbi)
nsfb_bbox_t rect;
LOG(("REDRAW SCROLL get rooot"));
//__menuet__debug_out("REDRAW SCROLL get root");
//DBG("REDRAW SCROLL get root");
fbtk_widget_t *root = fbtk_get_root_widget(widget);
LOG(("REDRAW SCROLL get bbox"));
//__menuet__debug_out("REDRAW SCROLL get bbox");
//DBG("REDRAW SCROLL get bbox");
fbtk_get_bbox(widget, &bbox);
LOG(("REDRAW SCROLL claim"));
//__menuet__debug_out("REDRAW SCROLL claim");
//DBG("REDRAW SCROLL claim");
nsfb_claim(root->u.root.fb, &bbox);
rect = bbox;
@ -85,7 +91,7 @@ vscroll_redraw(fbtk_widget_t *widget, fbtk_callback_info *cbi)
nsfb_plot_rectangle(root->u.root.fb, &rect, 1, 0xFF999999, false, false);
LOG(("REDRAW SCROLL widg"));
//__menuet__debug_out("REDRAW SCROLL widg");
//DBG("REDRAW SCROLL widg");
/* scroll bar */
if ((widget->u.scroll.maximum - widget->u.scroll.minimum) > 0) {
@ -107,7 +113,7 @@ vscroll_redraw(fbtk_widget_t *widget, fbtk_callback_info *cbi)
nsfb_plot_rectangle_fill(root->u.root.fb, &rect, widget->bg);
LOG(("REDRAW SCROLL upd"));
//__menuet__debug_out("RED upd");
//DBG("RED upd");
//STUB
nsfb_update(root->u.root.fb, &bbox); //&bbox
@ -120,7 +126,7 @@ vscroll_drag(fbtk_widget_t *widget, fbtk_callback_info *cbi)
{
LOG(("REDRAG SCROLL"));
//__menuet__debug_out("REDRAG SCROLL");
//DBG("REDRAG SCROLL");
int newpos;
fbtk_widget_t *scrollw = cbi->context;
@ -146,7 +152,7 @@ vscrollu_click(fbtk_widget_t *widget, fbtk_callback_info *cbi)
{
LOG(("REDRAW Ck SCROLL"));
//__menuet__debug_out("REDRAW Ck SCROLL");
//DBG("REDRAW Ck SCROLL");
int newpos;
fbtk_widget_t *scrollw = cbi->context;
@ -168,7 +174,7 @@ vscrolld_click(fbtk_widget_t *widget, fbtk_callback_info *cbi)
{
LOG(("REDRAW SCROLL 2"));
//__menuet__debug_out("REDRAW SCROLL 2");
//DBG("REDRAW SCROLL 2");
int newpos;
fbtk_widget_t *scrollw = cbi->context;
@ -189,7 +195,7 @@ static int
vscrollarea_click(fbtk_widget_t *widget, fbtk_callback_info *cbi)
{
LOG(("REDRAW SCROLL 3"));
//__menuet__debug_out("REDRAW SCROLL 3");
//DBG("REDRAW SCROLL 3");
int vscroll;
int vpos;
int newpos;
@ -270,7 +276,7 @@ fbtk_create_vscroll(fbtk_widget_t *parent,
{
LOG(("REDRAW SCROLL 4"));
//__menuet__debug_out("REDRAW SCROLL 4");
//DBG("REDRAW SCROLL 4");
fbtk_widget_t *neww;
neww = fbtk_widget_new(parent,
@ -321,7 +327,7 @@ hscroll_redraw(fbtk_widget_t *widget, fbtk_callback_info *cbi)
{
LOG(("REDRAW SCROLL 5"));
//__menuet__debug_out("REDRAW SCROLL 5");
//DBG("REDRAW SCROLL 5");
int hscroll;
int hpos;
nsfb_bbox_t bbox;
@ -383,7 +389,7 @@ hscrolll_click(fbtk_widget_t *widget, fbtk_callback_info *cbi)
{
LOG(("REDRAW SCROLL 6"));
//__menuet__debug_out("REDRAW SCROLL 6");
//DBG("REDRAW SCROLL 6");
int newpos;
fbtk_widget_t *scrollw = cbi->context;
@ -407,7 +413,7 @@ hscrollr_click(fbtk_widget_t *widget, fbtk_callback_info *cbi)
{
LOG(("REDRAW SCROLL 7"));
//__menuet__debug_out("REDRAW SCROLL 7");
//DBG("REDRAW SCROLL 7");
int newpos;
fbtk_widget_t *scrollw = cbi->context;
@ -429,7 +435,7 @@ hscroll_drag(fbtk_widget_t *widget, fbtk_callback_info *cbi)
{
LOG(("REDRAW SCROLL 8"));
//__menuet__debug_out("REDRAW SCROLL 8");
//DBG("REDRAW SCROLL 8");
int newpos;
fbtk_widget_t *scrollw = cbi->context;
@ -455,7 +461,7 @@ hscrollarea_click(fbtk_widget_t *widget, fbtk_callback_info *cbi)
{
LOG(("REDRAW SCROLL 9"));
//__menuet__debug_out("REDRAW SCROLL 9");
//DBG("REDRAW SCROLL 9");
int hscroll;
int hpos;
int newpos;
@ -514,7 +520,7 @@ fbtk_create_hscroll(fbtk_widget_t *parent,
{
LOG(("REDRAW SCROLL 10"));
//__menuet__debug_out("REDRAW SCROLL 10");
//DBG("REDRAW SCROLL 10");
fbtk_widget_t *neww;
neww = fbtk_widget_new(parent,
@ -565,7 +571,7 @@ fbtk_set_scroll_parameters(fbtk_widget_t *widget,
int page)
{
LOG(("REDRAW SCROLL 11"));
//__menuet__debug_out("REDRAW SCROLL 11");
//DBG("REDRAW SCROLL 11");
if (widget == NULL)
return false;
@ -593,7 +599,7 @@ bool
fbtk_set_scroll_position(fbtk_widget_t *widget, int position)
{
LOG(("REDRAW SCROLL 12"));
//__menuet__debug_out("REDRAW SCROLL 12");
//DBG("REDRAW SCROLL 12");
if (widget == NULL)
return false;

View File

@ -91,7 +91,7 @@ char *url_to_path(const char *url)
if (res != URL_FUNC_OK) {
return NULL;
}
__menuet__debug_out("Calling url_unescape from findfile.c");
res = url_unescape(path, &respath);
free(path);
if (res != URL_FUNC_OK) {
@ -99,6 +99,7 @@ char *url_to_path(const char *url)
}
LOG(("Findfile url2path: %s", respath));
__menuet__debug_out("returning from url_to_path in findfile.c\n");
return respath;
}
@ -113,7 +114,7 @@ nsurl *gui_get_resource_url(const char *path)
raw = path_to_url(filepath_sfind(respaths, buf, path));
LOG(("Findfile gui: %s", raw));
LOG(("Findfile gui: path is %s, raw is %s", path, raw));
if (raw != NULL) {
nsurl_create(raw, &url);
free(raw);

View File

@ -41,6 +41,12 @@
#define BOLD_WEIGHT 700
#ifdef DBG
#undef DBG
#endif
//#define DBG(s) __menuet__debug_out(s) /* For the debug messages in BOARD */
#define DBG(s) LOG((s)) /* So that we see debug in Netsurf's LOG files */
static FT_Library library;
static FTC_Manager ft_cmanager;
static FTC_CMapCache ft_cmap_cache ;
@ -197,7 +203,7 @@ LOG(("Freetype init..."));
}
LOG(("Freetype cache..."));
__menuet__debug_out("Ft cache\n");
DBG("Ft cache\n");
/* cache manager initialise */
error = FTC_Manager_New(library,
max_faces,
@ -214,7 +220,7 @@ __menuet__debug_out("Ft cache\n");
LOG(("Freetype map cache..."));
__menuet__debug_out("Ft map cache\n");
DBG("Ft map cache\n");
error = FTC_CMapCache_New(ft_cmanager, &ft_cmap_cache);
error = FTC_ImageCache_New(ft_cmanager, &ft_image_cache);
@ -223,7 +229,7 @@ __menuet__debug_out("Ft map cache\n");
LOG(("Freetype load fonts..."));
__menuet__debug_out("Ft load fonts\n");
DBG("Ft load fonts\n");
/* Start with the sans serif font */
fb_face = fb_new_face(nsoption_charp(fb_face_sans_serif),
@ -232,7 +238,7 @@ __menuet__debug_out("Ft load fonts\n");
if (fb_face == NULL) {
LOG(("Freetype load fonts failed due SANS unavailable :(..."));
__menuet__debug_out("Ft Z:(((\n");
DBG("Ft Z:(((\n");
/* The sans serif font is the default and must be found. */
LOG(("Could not find the default font\n"));
FTC_Manager_Done(ft_cmanager);
@ -243,7 +249,7 @@ __menuet__debug_out("Ft Z:(((\n");
}
LOG(("Freetype loaded sans.."));
__menuet__debug_out("Ft sans loaded:)\n");
DBG("Ft sans loaded:)\n");
/* Bold sans serif face */
fb_face = fb_new_face(nsoption_charp(fb_face_sans_serif_bold),
@ -346,7 +352,7 @@ __menuet__debug_out("Ft sans loaded:)\n");
}
LOG(("Freetype fonts ready..."));
__menuet__debug_out("Ft ready :)\n");
DBG("Ft ready :)\n");
/* set the default render mode */
if (nsoption_bool(fb_font_monochrome) == true)

View File

@ -64,6 +64,12 @@
#define NSFB_TOOLBAR_DEFAULT_LAYOUT "blfsrut"
#ifdef DBG
#undef DBG
#endif
#define DBG(s) __menuet__debug_out(s) /* For the debug messages in BOARD */
//#define DBG(s) LOG((s)) /* So that we see debug in Netsurf's LOG files */
fbtk_widget_t *fbtk;
struct gui_window *input_window = NULL;
@ -546,17 +552,17 @@ main(int argc, char** argv)
z=0x20;
strcpy(p, *z);
__menuet__debug_out("PATH1...\n");
__menuet__debug_out(p);
__menuet__debug_out("PATH1...\n");
DBG("PATH1...\n");
DBG(p);
DBG("PATH1...\n");
*(strrchr(p, '/')+1)='\0';
strcpy(strrchr(p, '/')+1, "res/");
__menuet__debug_out("PATH1...\n");
__menuet__debug_out(p);
__menuet__debug_out("PATH1...\n");
DBG("PATH1...\n");
DBG(p);
DBG("PATH1...\n");
asm volatile ("int $0x40"::"a"(30), "b"(1), "c"(p));
@ -578,15 +584,18 @@ main(int argc, char** argv)
options = filepath_find(respaths, "Choices");
messages = filepath_find(respaths, "messages");
__menuet__debug_out("===path to msg\n");
__menuet__debug_out(messages);
__menuet__debug_out("\n===path to msg\n");
LOG(("gui.c : printing kolibri DEBUG messages for BOARD"));
DBG("====================START\n");
DBG(messages);
DBG("====================END\n");
//netsurf_init(&argc, &argv, options, "res/messages");
LOG(("Calling netsurf_init"));
netsurf_init(&argc, &argv, options, messages);
extern HTTP_INIT();
DBG("Calling HTTP_INIT() for KolibriOS http lib..");
HTTP_INIT();
DBG(("NS HTTP_INIT okay"));
LOG(("NS init okay"));
free(messages);
@ -612,16 +621,14 @@ main(int argc, char** argv)
return 0;
}
void
gui_poll(bool active)
{
LOG(("GUI poll in"));
/* LOG(("GUI poll in")); */
nsfb_event_t event;
int timeout; /* timeout in miliseconds */
LOG(("schedule run"));
/* LOG(("schedule run")); */
/* run the scheduler and discover how long to wait for the next event */
timeout = schedule_run();
@ -629,22 +636,21 @@ LOG(("schedule run"));
if (active)
timeout = 0;
LOG(("redraw pending"));
/* LOG(("redraw pending")); */
/* if redraws are pending do not wait for event, return immediately */
if (fbtk_get_redraw_pending(fbtk))
timeout = 0;
LOG(("fbtk event"));
if (fbtk_event(fbtk, &event, timeout)) {
if ((event.type == NSFB_EVENT_CONTROL) &&
(event.value.controlcode == NSFB_CONTROL_QUIT))
netsurf_quit = true;
}
LOG(("fbtk redraw"));
/* LOG(("fbtk redraw")); */
fbtk_redraw(fbtk);
LOG(("GUI poll out success"));
/* LOG(("GUI poll out success")); */
}
void

View File

@ -25,6 +25,6 @@ OBJS := gui.o framebuffer.o tree.o schedule.o \
OUTFILE = TEST.o
CFLAGS += -I ../include/ -I ../ -I../../ -I./ -I/home/sourcerer/kos_src/newenginek/kolibri/include
CFLAGS += -I ../include/ -I ../ -I../../ -I./ -I/home/sourcerer/kos_src/newenginek/kolibri/include -I ../../libnsfb/include/ -I ../../libwapcaplet/include/ -I ../../libcss/include/
include $(MENUETDEV)/makefiles/Makefile_for_o_lib

Binary file not shown.

File diff suppressed because it is too large Load Diff

View File

@ -7,7 +7,7 @@ OBJS = about.o base64.o bitmap_fbtk.o bitmap.o bmp.o box_construct.o \
generics.o gif.o gui.o hand_image.o hashtable.o history_core.o \
history_global_core.o history_image_g.o history_image.o hlcache.o \
hotlist.o html_forms.o html_interaction.o html.o html_redraw.o \
html_script.o ico.o image_cache.o imagemap.o image.o internal.o \
html_script.o http.o ico.o image_cache.o imagemap.o image.o internal.o \
jpeg.o knockout.o layout.o left_arrow_g.o left_arrow.o libdom.o \
list.o llcache.o locale.o localhistory.o login.o log.o menu_image.o \
messages.o mimesniff.o misc.o mouse.o move_image.o netsurf.o none.o \
@ -22,10 +22,10 @@ OBJS = about.o base64.o bitmap_fbtk.o bitmap.o bmp.o box_construct.o \
textplain.o throbber0.o throbber1.o throbber2.o throbber3.o \
throbber4.o throbber5.o throbber6.o throbber7.o throbber8.o \
thumb_ddesk.o thumbnail.o tree_ddesk.o tree.o tree_url_node.o \
urldb.o url.o useragent.o user.o utf8.o utils.o utils_utils.o \
urldb.o url.o useragent.o user.o utf8.o utils.o utils_utils.o\
version.o window.o www-authenticate.o snprintf.o stubs.o divdi3.o
LIBS += -lm -lcurl -liconv -lnsbmp -lnsgif -lpng -ljpeg -lz -lnsfb -lwapcaplet -lcss -ldom -lhubbub -lparserutils -lfreetype2
LIBS += -lm -liconv -lnsbmp -lnsgif -lpng -ljpeg -lz -lnsfb -lwapcaplet -lcss -ldom -lhubbub -lparserutils -lfreetype2
OUTFILE = _netsurf

Some files were not shown because too many files have changed in this diff Show More