netsurf: branch master updated. release/3.2-87-g0c7c417
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/0c7c4173c22586f5e033c...
...commit http://git.netsurf-browser.org/netsurf.git/commit/0c7c4173c22586f5e033cfd...
...tree http://git.netsurf-browser.org/netsurf.git/tree/0c7c4173c22586f5e033cfdf0...
The branch, master has been updated
via 0c7c4173c22586f5e033cfdf004fba9013084efa (commit)
via 685e4a7fc5b873e2a252e90adf2e10ccc2401b64 (commit)
via 521d1824cf7fbdb0afe1eba2e7809bc4b8d8b3e3 (commit)
via 09509a90956ffb60105271fbee178897862b6d3b (commit)
via 265f63e67968cfcc23e785fe7b8b38a7961572f1 (commit)
from 1a2040bc726b151a1d1b1459ae0fbccef66d7d82 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=0c7c4173c22586f5e03...
commit 0c7c4173c22586f5e033cfdf004fba9013084efa
Author: Vincent Sanders <vince(a)kyllikki.org>
Commit: Vincent Sanders <vince(a)kyllikki.org>
remove use of deprecated netsurf_quit variable in win32
The core no longer needs to run the event polling loop as fetches are now
scheduler driven. This is part of a series which will ultimately remove
netsurf_poll callback altogether.
diff --git a/windows/gui.c b/windows/gui.c
index 19a31c1..b7ca313 100644
--- a/windows/gui.c
+++ b/windows/gui.c
@@ -61,6 +61,8 @@
#include "windows/windbg.h"
#include "windows/filetype.h"
+static bool win32_quit = false;
+
HINSTANCE hInstance; /** win32 application instance handle. */
struct gui_window *input_window = NULL;
@@ -95,37 +97,42 @@ static void nsws_set_scale(struct gui_window *gw, float scale)
browser_window_set_scale(gw->bw, scale, true);
}
-
-static void win32_poll(bool active)
+/* exported interface documented in gui.h */
+void win32_run(void)
{
MSG Msg; /* message from system */
BOOL bRet; /* message fetch result */
int timeout; /* timeout in miliseconds */
UINT timer_id = 0;
- /* run the scheduler and discover how long to wait for the next event */
- timeout = schedule_run();
+ while (!win32_quit) {
+ /* run the scheduler and discover how long to wait for
+ * the next event.
+ */
+ timeout = schedule_run();
- if (timeout == 0) {
- bRet = PeekMessage(&Msg, NULL, 0, 0, PM_REMOVE);
- } else {
- if (timeout > 0) {
- /* set up a timer to ensure we get woken */
- timer_id = SetTimer(NULL, 0, timeout, NULL);
- }
+ if (timeout == 0) {
+ bRet = PeekMessage(&Msg, NULL, 0, 0, PM_REMOVE);
+ } else {
+ if (timeout > 0) {
+ /* set up a timer to ensure we get woken */
+ timer_id = SetTimer(NULL, 0, timeout, NULL);
+ }
- /* wait for a message */
- bRet = GetMessage(&Msg, NULL, 0, 0);
+ /* wait for a message */
+ bRet = GetMessage(&Msg, NULL, 0, 0);
- /* if a timer was sucessfully created remove it */
- if (timer_id != 0) {
- KillTimer(NULL, timer_id);
+ /* if a timer was sucessfully created remove it */
+ if (timer_id != 0) {
+ KillTimer(NULL, timer_id);
+ timer_id = 0;
+ }
}
- }
- if (bRet > 0) {
- TranslateMessage(&Msg);
- DispatchMessage(&Msg);
+ if (bRet > 0) {
+ TranslateMessage(&Msg);
+ DispatchMessage(&Msg);
+ }
}
}
@@ -1124,7 +1131,7 @@ nsws_window_event_callback(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
RemoveProp(hwnd, TEXT("GuiWnd"));
browser_window_destroy(gw->bw);
if (--open_windows <= 0) {
- netsurf_quit = true;
+ win32_quit = true;
}
break;
@@ -2126,7 +2133,6 @@ struct gui_fetch_table *win32_fetch_table = &fetch_table;
static struct gui_browser_table browser_table = {
- .poll = win32_poll,
.schedule = win32_schedule,
};
diff --git a/windows/gui.h b/windows/gui.h
index 82ae836..007afe7 100644
--- a/windows/gui.h
+++ b/windows/gui.h
@@ -97,5 +97,9 @@ nserror nsws_create_main_class(HINSTANCE hinstance);
*/
bool nsws_window_go(HWND hwnd, const char *url);
+/**
+ * Run the win32 message loop with scheduling
+ */
+void win32_run(void);
#endif
diff --git a/windows/main.c b/windows/main.c
index 20f9f04..40b083f 100644
--- a/windows/main.c
+++ b/windows/main.c
@@ -54,7 +54,7 @@ static nsurl *gui_get_resource_url(const char *path)
return url;
}
-/**
+/**
* Ensures output logging stream is available
*/
static bool nslog_ensure(FILE *fptr)
@@ -70,7 +70,7 @@ static bool nslog_ensure(FILE *fptr)
}
/**
- * Set option defaults for framebuffer frontend
+ * Set option defaults for windows frontend
*
* @param defaults The option table to update.
* @return error status.
@@ -202,7 +202,7 @@ WinMain(HINSTANCE hInstance, HINSTANCE hLastInstance, LPSTR lpcli, int ncmd)
if (ret != NSERROR_OK) {
warn_user(messages_get_errorcode(ret), 0);
} else {
- netsurf_main_loop();
+ win32_run();
}
netsurf_exit();
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=685e4a7fc5b873e2a25...
commit 685e4a7fc5b873e2a252e90adf2e10ccc2401b64
Author: Vincent Sanders <vince(a)kyllikki.org>
Commit: Vincent Sanders <vince(a)kyllikki.org>
remove use of deprecated netsurf_quit variable
The core no longer needs to run the event polling loop as fetches are now
scheduler driven. This is part of a series which will ultimately remove
netsurf_poll callback altogether.
The Atari maintainer probably wants to look at moving the ami_quit
handling inside atari_poll() to further reduce overhead.
diff --git a/atari/gui.c b/atari/gui.c
index 9f3d7da..d516ee4 100644
--- a/atari/gui.c
+++ b/atari/gui.c
@@ -77,6 +77,8 @@
#include "atari/filetype.h"
#include "cflib.h"
+static bool atari_quit = false;
+
struct gui_window *input_window = NULL;
struct gui_window *window_list = NULL;
void *h_gem_rsrc;
@@ -117,7 +119,7 @@ static void gui_window_set_url(struct gui_window *w, const char *url);
/**
* Core atari event processing.
*/
-static void gui_poll(bool active)
+static void atari_poll(void)
{
struct gui_window *tmp;
@@ -154,7 +156,7 @@ static void gui_poll(bool active)
break;
case AP_TERM:
- netsurf_quit = true;
+ atari_quit = true;
break;
default:
break;
@@ -959,6 +961,11 @@ static nserror set_defaults(struct nsoption_s *defaults)
return NSERROR_OK;
}
+static char *theapp = (char*)"NetSurf";
+
+/**
+ * Initialise atari gui.
+ */
static void gui_init(int argc, char** argv)
{
char buf[PATH_MAX];
@@ -1020,7 +1027,6 @@ static void gui_init(int argc, char** argv)
LOG(("Initializing NKC..."));
nkc_init();
-
LOG(("Initializing plotters..."));
plot_init(nsoption_charp(atari_font_driver));
@@ -1028,11 +1034,7 @@ static void gui_init(int argc, char** argv)
aes_event_in.emi_m1.g_w = 1;
aes_event_in.emi_m1.g_h = 1;
//next_poll = clock() + (CLOCKS_PER_SEC>>3);
-}
-static char *theapp = (char*)"NetSurf";
-static void gui_init2(int argc, char** argv)
-{
deskmenu_init();
menu_register( -1, theapp);
if (sys_type() & (SYS_MAGIC|SYS_NAES|SYS_XAAES)) {
@@ -1087,7 +1089,6 @@ static struct gui_fetch_table atari_fetch_table = {
};
static struct gui_browser_table atari_browser_table = {
- .poll = gui_poll,
.schedule = atari_schedule,
.quit = gui_quit,
@@ -1096,7 +1097,8 @@ static struct gui_browser_table atari_browser_table = {
};
/* #define WITH_DBG_LOGFILE 1 */
-/** Entry point from OS.
+/**
+ * Entry point from OS.
*
* /param argc The number of arguments in the string vector.
* /param argv The argument string vector.
@@ -1170,9 +1172,6 @@ int main(int argc, char** argv)
LOG(("Initializing GUI..."));
gui_init(argc, argv);
- LOG(("Initializing GUI2"));
- gui_init2(argc, argv);
-
graf_mouse( ARROW , NULL);
LOG(("Creating initial browser window..."));
@@ -1197,8 +1196,10 @@ int main(int argc, char** argv)
if (ret != NSERROR_OK) {
warn_user(messages_get_errorcode(ret), 0);
} else {
- LOG(("Entering NetSurf mainloop..."));
- netsurf_main_loop();
+ LOG(("Entering Atari event mainloop..."));
+ while (!atari_quit) {
+ atari_poll();
+ }
}
netsurf_exit();
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=521d1824cf7fbdb0afe...
commit 521d1824cf7fbdb0afe1eba2e7809bc4b8d8b3e3
Author: Vincent Sanders <vince(a)kyllikki.org>
Commit: Vincent Sanders <vince(a)kyllikki.org>
whitespace and documentation cleanups
diff --git a/atari/gui.c b/atari/gui.c
index a209866..9f3d7da 100644
--- a/atari/gui.c
+++ b/atari/gui.c
@@ -17,7 +17,9 @@
*/
/**
- * \file Provides all the mandatory functions prefixed with gui_ for atari
+ * \file
+ *
+ * Provides all the mandatory functions prefixed with gui_ for atari
*/
#include <sys/types.h>
@@ -75,16 +77,13 @@
#include "atari/filetype.h"
#include "cflib.h"
-#define TODO() (0)/*printf("%s Unimplemented!\n", __FUNCTION__)*/
-
struct gui_window *input_window = NULL;
struct gui_window *window_list = NULL;
-void * h_gem_rsrc;
+void *h_gem_rsrc;
long next_poll;
bool rendering = false;
GRECT desk_area;
-
/* Comandline / Options: */
int option_window_width;
int option_window_height;
@@ -92,7 +91,7 @@ int option_window_x;
int option_window_y;
/* Defaults to option_homepage_url, commandline options overwrites that value */
-const char * option_homepage_url;
+const char *option_homepage_url;
/* path to choices file: */
char options[PATH_MAX];
@@ -115,26 +114,29 @@ short aes_msg_out[8];
bool gui_window_get_scroll(struct gui_window *w, int *sx, int *sy);
static void gui_window_set_url(struct gui_window *w, const char *url);
+/**
+ * Core atari event processing.
+ */
static void gui_poll(bool active)
{
- struct gui_window *tmp;
+ struct gui_window *tmp;
short mx, my, dummy;
aes_event_in.emi_tlow = schedule_run();
if(rendering){
- aes_event_in.emi_tlow = nsoption_int(atari_gui_poll_timeout);
- }
+ aes_event_in.emi_tlow = nsoption_int(atari_gui_poll_timeout);
+ }
if(aes_event_in.emi_tlow < 0) {
- aes_event_in.emi_tlow = 10000;
- printf("long poll!\n");
+ aes_event_in.emi_tlow = 10000;
+ printf("long poll!\n");
}
- if(input_window && input_window->root->redraw_slots.areas_used > 0) {
- window_process_redraws(input_window->root);
- }
+ if(input_window && input_window->root->redraw_slots.areas_used > 0) {
+ window_process_redraws(input_window->root);
+ }
graf_mkstate(&mx, &my, &dummy, &dummy);
@@ -142,136 +144,161 @@ static void gui_poll(bool active)
aes_event_in.emi_m1.g_y = my;
evnt_multi_fast(&aes_event_in, aes_msg_out, &aes_event_out);
if(gemtk_wm_dispatch_event(&aes_event_in, &aes_event_out, aes_msg_out) == 0) {
- if( (aes_event_out.emo_events & MU_MESAG) != 0 ) {
- LOG(("WM: %d\n", aes_msg_out[0]));
- switch(aes_msg_out[0]) {
-
- case MN_SELECTED:
- LOG(("Menu Item: %d\n",aes_msg_out[4]));
- deskmenu_dispatch_item(aes_msg_out[3], aes_msg_out[4]);
- break;
-
- case AP_TERM:
- netsurf_quit = true;
- break;
- default:
- break;
- }
- }
- if((aes_event_out.emo_events & MU_KEYBD) != 0) {
- uint16_t nkc = gem_to_norm( (short)aes_event_out.emo_kmeta,
- (short)aes_event_out.emo_kreturn);
- deskmenu_dispatch_keypress(aes_event_out.emo_kreturn,
- aes_event_out.emo_kmeta, nkc);
- }
+ if( (aes_event_out.emo_events & MU_MESAG) != 0 ) {
+ LOG(("WM: %d\n", aes_msg_out[0]));
+ switch(aes_msg_out[0]) {
+
+ case MN_SELECTED:
+ LOG(("Menu Item: %d\n",aes_msg_out[4]));
+ deskmenu_dispatch_item(aes_msg_out[3], aes_msg_out[4]);
+ break;
+
+ case AP_TERM:
+ netsurf_quit = true;
+ break;
+ default:
+ break;
+ }
+ }
+ if((aes_event_out.emo_events & MU_KEYBD) != 0) {
+ uint16_t nkc = gem_to_norm( (short)aes_event_out.emo_kmeta,
+ (short)aes_event_out.emo_kreturn);
+ deskmenu_dispatch_keypress(aes_event_out.emo_kreturn,
+ aes_event_out.emo_kmeta, nkc);
+ }
}
tmp = window_list;
while(tmp){
- if(tmp->root->redraw_slots.areas_used > 0){
- window_process_redraws(tmp->root);
- }
- tmp = tmp->next;
+ if(tmp->root->redraw_slots.areas_used > 0){
+ window_process_redraws(tmp->root);
+ }
+ tmp = tmp->next;
}
- // TODO: implement generic treeview redraw function
- // TODO: rename hl to atari_hotlist or create getter for it...
-
- atari_treeview_flush_redraws();
+ /** @todo implement generic treeview redraw function. */
+ /** @todo rename hl to atari_hotlist or create getter for it... */
+ atari_treeview_flush_redraws();
}
-
+/**
+ * Create and open a gui window for a browsing context.
+ *
+ * \param bw bw to create gui_window for
+ * \param existing an existing gui_window, may be NULL
+ * \param flags flags for gui window creation
+ * \return gui window, or NULL on error
+ *
+ * If GW_CREATE_CLONE flag is set existing is non-NULL.
+ *
+ * The created gui_window must include a reference to the browser
+ * window passed in the bw param.
+ */
static struct gui_window *
gui_window_create(struct browser_window *bw,
- struct gui_window *existing,
- gui_window_create_flags flags) {
+ struct gui_window *existing,
+ gui_window_create_flags flags)
+{
struct gui_window *gw=NULL;
LOG(( "gw: %p, BW: %p, existing %p, flags: %d\n" , gw, bw, existing,
- (int)flags
- ));
+ (int)flags
+ ));
gw = calloc(1, sizeof(struct gui_window));
if (gw == NULL)
- return NULL;
+ return NULL;
LOG(("new window: %p, bw: %p\n", gw, bw));
window_create(gw, bw, existing, WIDGET_STATUSBAR|WIDGET_TOOLBAR|WIDGET_RESIZE\
- |WIDGET_SCROLL);
+ |WIDGET_SCROLL);
if (gw->root->win) {
- GRECT pos = {
- option_window_x, option_window_y,
- option_window_width, option_window_height
- };
- gui_window_set_url(gw, "");
- gui_window_set_pointer(gw, BROWSER_POINTER_DEFAULT);
- gui_set_input_gui_window(gw);
- window_open(gw->root, gw, pos);
+ GRECT pos = {
+ option_window_x, option_window_y,
+ option_window_width, option_window_height
+ };
+ gui_window_set_url(gw, "");
+ gui_window_set_pointer(gw, BROWSER_POINTER_DEFAULT);
+ gui_set_input_gui_window(gw);
+ window_open(gw->root, gw, pos);
}
/* add the window to the window list: */
if( window_list == NULL ) {
- window_list = gw;
- gw->next = NULL;
- gw->prev = NULL;
+ window_list = gw;
+ gw->next = NULL;
+ gw->prev = NULL;
} else {
- struct gui_window * tmp = window_list;
- while( tmp->next != NULL ) {
- tmp = tmp->next;
- }
- tmp->next = gw;
- gw->prev = tmp;
- gw->next = NULL;
+ struct gui_window * tmp = window_list;
+ while( tmp->next != NULL ) {
+ tmp = tmp->next;
+ }
+ tmp->next = gw;
+ gw->prev = tmp;
+ gw->next = NULL;
}
return( gw );
}
-void gui_window_destroy(struct gui_window *w)
+/**
+ * Destroy previously created gui window
+ *
+ * \param gw The gui window to destroy.
+ */
+void gui_window_destroy(struct gui_window *gw)
{
- if (w == NULL)
- return;
+ if (gw == NULL)
+ return;
LOG(("%s\n", __FUNCTION__ ));
- if (input_window == w) {
- gui_set_input_gui_window(NULL);
+ if (input_window == gw) {
+ gui_set_input_gui_window(NULL);
}
- nsatari_search_session_destroy(w->search);
- free(w->browser);
- free(w->status);
- free(w->title);
- free(w->url);
+ nsatari_search_session_destroy(gw->search);
+ free(gw->browser);
+ free(gw->status);
+ free(gw->title);
+ free(gw->url);
/* unlink the window: */
- if(w->prev != NULL ) {
- w->prev->next = w->next;
+ if(gw->prev != NULL ) {
+ gw->prev->next = gw->next;
} else {
- window_list = w->next;
+ window_list = gw->next;
}
- if( w->next != NULL ) {
- w->next->prev = w->prev;
+ if( gw->next != NULL ) {
+ gw->next->prev = gw->prev;
}
- window_unref_gui_window(w->root, w);
+ window_unref_gui_window(gw->root, gw);
- free(w);
- w = NULL;
+ free(gw);
+ gw = NULL;
if(input_window == NULL) {
- w = window_list;
- while( w != NULL ) {
- if(w->root) {
- gui_set_input_gui_window(w);
- break;
- }
- w = w->next;
- }
+ gw = window_list;
+ while( gw != NULL ) {
+ if(gw->root) {
+ gui_set_input_gui_window(w);
+ break;
+ }
+ gw = gw->next;
+ }
}
}
+/**
+ * Find the current dimensions of a browser window's content area.
+ *
+ * \param w gui_window to measure
+ * \param width receives width of window
+ * \param height receives height of window
+ * \param scaled whether to return scaled values
+ */
static void
gui_window_get_dimensions(struct gui_window *w,
int *width,
@@ -279,69 +306,77 @@ gui_window_get_dimensions(struct gui_window *w,
bool scaled)
{
if (w == NULL)
- return;
+ return;
GRECT rect;
window_get_grect(w->root, BROWSER_AREA_CONTENT, &rect);
*width = rect.g_w;
*height = rect.g_h;
}
+/**
+ * Set the title of a window.
+ *
+ * \param gw window to update
+ * \param title new window title
+ */
static void gui_window_set_title(struct gui_window *gw, const char *title)
{
-
if (gw == NULL)
- return;
+ return;
if (gw->root) {
- int l;
- char * conv;
- l = strlen(title)+1;
- if (utf8_to_local_encoding(title, l-1, &conv) == NSERROR_OK ) {
- l = MIN((uint32_t)atari_sysinfo.aes_max_win_title_len, strlen(conv));
- if(gw->title == NULL)
- gw->title = malloc(l);
- else
- gw->title = realloc(gw->title, l);
-
- strncpy(gw->title, conv, l);
- free( conv );
- } else {
- l = MIN((size_t)atari_sysinfo.aes_max_win_title_len, strlen(title));
- if(gw->title == NULL)
- gw->title = malloc(l);
- else
- gw->title = realloc(gw->title, l);
- strncpy(gw->title, title, l);
- }
- gw->title[l] = 0;
- if(input_window == gw)
- window_set_title(gw->root, gw->title);
+ int l;
+ char * conv;
+ l = strlen(title)+1;
+ if (utf8_to_local_encoding(title, l-1, &conv) == NSERROR_OK ) {
+ l = MIN((uint32_t)atari_sysinfo.aes_max_win_title_len, strlen(conv));
+ if(gw->title == NULL)
+ gw->title = malloc(l);
+ else
+ gw->title = realloc(gw->title, l);
+
+ strncpy(gw->title, conv, l);
+ free( conv );
+ } else {
+ l = MIN((size_t)atari_sysinfo.aes_max_win_title_len, strlen(title));
+ if(gw->title == NULL)
+ gw->title = malloc(l);
+ else
+ gw->title = realloc(gw->title, l);
+ strncpy(gw->title, title, l);
+ }
+ gw->title[l] = 0;
+ if(input_window == gw)
+ window_set_title(gw->root, gw->title);
}
}
/**
- * set the status bar message
+ * Set the status bar of a browser window.
+ *
+ * \param w gui_window to update
+ * \param text new status text
*/
void gui_window_set_status(struct gui_window *w, const char *text)
{
int l;
if (w == NULL || text == NULL)
- return;
+ return;
assert(w->root);
l = strlen(text)+1;
if(w->status == NULL)
- w->status = malloc(l);
+ w->status = malloc(l);
else
- w->status = realloc(w->status, l);
+ w->status = realloc(w->status, l);
strncpy(w->status, text, l);
w->status[l] = 0;
if(input_window == w)
- window_set_stauts(w->root, (char*)text);
+ window_set_stauts(w->root, (char*)text);
}
static void atari_window_reformat(struct gui_window *gw)
@@ -359,7 +394,7 @@ static void gui_window_redraw_window(struct gui_window *gw)
CMP_BROWSER b;
GRECT rect;
if (gw == NULL)
- return;
+ return;
b = gw->browser;
window_get_grect(gw->root, BROWSER_AREA_CONTENT, &rect);
window_schedule_redraw_grect(gw->root, &rect);
@@ -371,7 +406,7 @@ static void gui_window_update_box(struct gui_window *gw, const struct rect *rect
struct gemtk_wm_scroll_info_s *slid;
if (gw == NULL)
- return;
+ return;
slid = gemtk_wm_get_scroll_info(gw->root->win);
@@ -387,7 +422,7 @@ static void gui_window_update_box(struct gui_window *gw, const struct rect *rect
bool gui_window_get_scroll(struct gui_window *w, int *sx, int *sy)
{
if (w == NULL)
- return false;
+ return false;
window_get_scroll(w->root, sx, sy);
@@ -397,9 +432,9 @@ bool gui_window_get_scroll(struct gui_window *w, int *sx, int *sy)
static void gui_window_set_scroll(struct gui_window *w, int sx, int sy)
{
if ( (w == NULL)
- || (w->browser->bw == NULL)
- || (!browser_window_has_content(w->browser->bw)))
- return;
+ || (w->browser->bw == NULL)
+ || (!browser_window_has_content(w->browser->bw)))
+ return;
LOG(("scroll (gui_window: %p) %d, %d\n", w, sx, sy));
window_scroll_by(w->root, sx, sy);
@@ -407,25 +442,31 @@ static void gui_window_set_scroll(struct gui_window *w, int sx, int sy)
}
-/* It seems this method is called when content size got adjusted,
- so that we can adjust scroll info. We also have to call it when tab
- change occurs.
-*/
+/**
+ * Update the extent of the inside of a browser window to that of the
+ * current content.
+ *
+ * It seems this method is called when content size got adjusted, so
+ * that we can adjust scroll info. We also have to call it when tab
+ * change occurs.
+ *
+ * \param gw gui_window to update the extent of
+ */
static void gui_window_update_extent(struct gui_window *gw)
{
- if(browser_window_has_content(gw->browser->bw)) {
- // TODO: store content size!
- if(window_get_active_gui_window(gw->root) == gw) {
- window_set_content_size( gw->root,
- content_get_width(gw->browser->bw->current_content),
- content_get_height(gw->browser->bw->current_content)
- );
- window_update_back_forward(gw->root);
- GRECT area;
- window_get_grect(gw->root, BROWSER_AREA_CONTENT, &area);
- window_schedule_redraw_grect(gw->root, &area);
- }
+ if(browser_window_has_content(gw->browser->bw)) {
+ /** @todo store content size. */
+ if(window_get_active_gui_window(gw->root) == gw) {
+ window_set_content_size( gw->root,
+ content_get_width(gw->browser->bw->current_content),
+ content_get_height(gw->browser->bw->current_content)
+ );
+ window_update_back_forward(gw->root);
+ GRECT area;
+ window_get_grect(gw->root, BROWSER_AREA_CONTENT, &area);
+ window_schedule_redraw_grect(gw->root, &area);
+ }
}
}
@@ -436,76 +477,76 @@ static void gui_window_update_extent(struct gui_window *gw)
void gui_window_set_pointer(struct gui_window *gw, gui_pointer_shape shape)
{
if (gw == NULL)
- return;
+ return;
switch (shape) {
case GUI_POINTER_POINT: /* link */
- gw->cursor = &gem_cursors.hand;
- break;
+ gw->cursor = &gem_cursors.hand;
+ break;
case GUI_POINTER_MENU:
- gw->cursor = &gem_cursors.menu;
- break;
+ gw->cursor = &gem_cursors.menu;
+ break;
case GUI_POINTER_CARET: /* input */
- gw->cursor = &gem_cursors.ibeam;
- break;
+ gw->cursor = &gem_cursors.ibeam;
+ break;
case GUI_POINTER_CROSS:
- gw->cursor = &gem_cursors.cross;
- break;
+ gw->cursor = &gem_cursors.cross;
+ break;
case GUI_POINTER_MOVE:
- gw->cursor = &gem_cursors.sizeall;
- break;
+ gw->cursor = &gem_cursors.sizeall;
+ break;
case GUI_POINTER_RIGHT:
case GUI_POINTER_LEFT:
- gw->cursor = &gem_cursors.sizewe;
- break;
+ gw->cursor = &gem_cursors.sizewe;
+ break;
case GUI_POINTER_UP:
case GUI_POINTER_DOWN:
- gw->cursor = &gem_cursors.sizens;
- break;
+ gw->cursor = &gem_cursors.sizens;
+ break;
case GUI_POINTER_RU:
case GUI_POINTER_LD:
- gw->cursor = &gem_cursors.sizenesw;
- break;
+ gw->cursor = &gem_cursors.sizenesw;
+ break;
case GUI_POINTER_RD:
case GUI_POINTER_LU:
- gw->cursor = &gem_cursors.sizenwse;
- break;
+ gw->cursor = &gem_cursors.sizenwse;
+ break;
case GUI_POINTER_WAIT:
- gw->cursor = &gem_cursors.wait;
- break;
+ gw->cursor = &gem_cursors.wait;
+ break;
case GUI_POINTER_PROGRESS:
- gw->cursor = &gem_cursors.appstarting;
- break;
+ gw->cursor = &gem_cursors.appstarting;
+ break;
case GUI_POINTER_NO_DROP:
- gw->cursor = &gem_cursors.nodrop;
- break;
+ gw->cursor = &gem_cursors.nodrop;
+ break;
case GUI_POINTER_NOT_ALLOWED:
- gw->cursor = &gem_cursors.deny;
- break;
+ gw->cursor = &gem_cursors.deny;
+ break;
case GUI_POINTER_HELP:
- gw->cursor = &gem_cursors.help;
- break;
+ gw->cursor = &gem_cursors.help;
+ break;
default:
- gw->cursor = &gem_cursors.arrow;
- break;
+ gw->cursor = &gem_cursors.arrow;
+ break;
}
if (input_window == gw) {
- gem_set_cursor(gw->cursor);
+ gem_set_cursor(gw->cursor);
}
}
@@ -515,36 +556,36 @@ static void gui_window_set_url(struct gui_window *w, const char *url)
int l;
if (w == NULL)
- return;
+ return;
l = strlen(url)+1;
if (w->url == NULL) {
- w->url = malloc(l);
+ w->url = malloc(l);
} else {
- w->url = realloc(w->url, l);
+ w->url = realloc(w->url, l);
}
strncpy(w->url, url, l);
w->url[l] = 0;
if(input_window == w->root->active_gui_window) {
- toolbar_set_url(w->root->toolbar, url);
+ toolbar_set_url(w->root->toolbar, url);
}
}
char * gui_window_get_url(struct gui_window *gw)
{
- if (gw == NULL) {
- return(NULL);
- }
- return(gw->url);
+ if (gw == NULL) {
+ return(NULL);
+ }
+ return(gw->url);
}
char * gui_window_get_title(struct gui_window *gw)
{
- if (gw == NULL) {
- return(NULL);
- }
- return(gw->title);
+ if (gw == NULL) {
+ return(NULL);
+ }
+ return(gw->title);
}
static void throbber_advance( void * data )
@@ -553,12 +594,12 @@ static void throbber_advance( void * data )
struct gui_window * gw = (struct gui_window *)data;
if (gw->root == NULL)
- return;
+ return;
if (gw->root->toolbar == NULL)
- return;
+ return;
if (gw->root->toolbar->throbber.running == false)
- return;
+ return;
toolbar_throbber_progress(gw->root->toolbar);
atari_schedule(1000, throbber_advance, gw );
@@ -567,7 +608,7 @@ static void throbber_advance( void * data )
static void gui_window_start_throbber(struct gui_window *w)
{
if (w == NULL)
- return;
+ return;
toolbar_set_throbber_state(w->root->toolbar, true);
atari_schedule(1000, throbber_advance, w );
@@ -577,9 +618,9 @@ static void gui_window_start_throbber(struct gui_window *w)
static void gui_window_stop_throbber(struct gui_window *w)
{
if (w == NULL)
- return;
+ return;
if (w->root->toolbar->throbber.running == false)
- return;
+ return;
atari_schedule(-1, throbber_advance, w);
@@ -588,9 +629,12 @@ static void gui_window_stop_throbber(struct gui_window *w)
rendering = false;
}
-/* Place caret in window */
-static void gui_window_place_caret(struct gui_window *w, int x, int y, int height,
- const struct rect *clip)
+/**
+ * Place caret in window
+ */
+static void
+gui_window_place_caret(struct gui_window *w, int x, int y, int height,
+ const struct rect *clip)
{
window_place_caret(w->root, 1, x, y, height, NULL);
w->root->caret.state |= CARET_STATE_ENABLED;
@@ -605,16 +649,22 @@ static void
gui_window_remove_caret(struct gui_window *w)
{
if (w == NULL)
- return;
+ return;
if ((w->root->caret.state & CARET_STATE_ENABLED) != 0) {
- //printf("gw hide caret\n");
- window_place_caret(w->root, 0, -1, -1, -1, NULL);
- w->root->caret.state &= ~CARET_STATE_ENABLED;
+ //printf("gw hide caret\n");
+ window_place_caret(w->root, 0, -1, -1, -1, NULL);
+ w->root->caret.state &= ~CARET_STATE_ENABLED;
}
return;
}
+/**
+ * Set a favicon for a gui window.
+ *
+ * \param g window to update.
+ * \param icon handle to object to use as icon.
+ */
static void
gui_window_set_icon(struct gui_window *g, hlcache_handle *icon)
{
@@ -623,7 +673,7 @@ gui_window_set_icon(struct gui_window *g, hlcache_handle *icon)
bmp_icon = (icon != NULL) ? content_get_bitmap(icon) : NULL;
g->icon = bmp_icon;
if(input_window == g) {
- window_set_icon(g->root, bmp_icon);
+ window_set_icon(g->root, bmp_icon);
}
}
@@ -653,27 +703,27 @@ static void gui_get_clipboard(char **buffer, size_t *length)
clip = scrap_txt_read();
if(clip == NULL) {
- return;
+ return;
} else {
- // clipboard is in atari encoding, convert it to utf8:
-
- size_t clip_len;
- char *utf8 = NULL;
-
- clip_len = strlen(clip);
- if (clip_len > 0) {
- nserror ret;
- ret = utf8_to_local_encoding(clip, clip_len, &utf8);
- if (ret == NSERROR_OK && utf8 != NULL) {
- *buffer = utf8;
- *length = strlen(utf8);
- } else {
- assert(ret == NSERROR_OK && utf8 != NULL);
- }
- }
+ // clipboard is in atari encoding, convert it to utf8:
+
+ size_t clip_len;
+ char *utf8 = NULL;
+
+ clip_len = strlen(clip);
+ if (clip_len > 0) {
+ nserror ret;
+ ret = utf8_to_local_encoding(clip, clip_len, &utf8);
+ if (ret == NSERROR_OK && utf8 != NULL) {
+ *buffer = utf8;
+ *length = strlen(utf8);
+ } else {
+ assert(ret == NSERROR_OK && utf8 != NULL);
+ }
+ }
- free(clip);
+ free(clip);
}
}
@@ -686,66 +736,67 @@ static void gui_get_clipboard(char **buffer, size_t *length)
* \param n_styles Number of text run styles in array
*/
static void gui_set_clipboard(const char *buffer, size_t length,
- nsclipboard_styles styles[], int n_styles)
+ nsclipboard_styles styles[], int n_styles)
{
if (length > 0 && buffer != NULL) {
- // convert utf8 input to atari encoding:
+ // convert utf8 input to atari encoding:
- nserror ret;
- char *clip = NULL;
+ nserror ret;
+ char *clip = NULL;
- ret = utf8_to_local_encoding(buffer,length, &clip);
- if (ret == NSERROR_OK) {
- scrap_txt_write(clip);
- } else {
- assert(ret == NSERROR_OK);
- }
- free(clip);
+ ret = utf8_to_local_encoding(buffer,length, &clip);
+ if (ret == NSERROR_OK) {
+ scrap_txt_write(clip);
+ } else {
+ assert(ret == NSERROR_OK);
+ }
+ free(clip);
}
}
static void gui_401login_open(nsurl *url, const char *realm,
- nserror (*cb)(bool proceed, void *pw), void *cbpw)
+ nserror (*cb)(bool proceed, void *pw), void *cbpw)
{
bool bres;
char * out = NULL;
bres = login_form_do( url, (char*)realm, &out);
if (bres) {
- LOG(("url: %s, realm: %s, auth: %s\n", url, realm, out ));
- urldb_set_auth_details(url, realm, out);
+ LOG(("url: %s, realm: %s, auth: %s\n", url, realm, out ));
+ urldb_set_auth_details(url, realm, out);
}
if (out != NULL) {
- free( out );
+ free( out );
}
if (cb != NULL) {
- cb(bres, cbpw);
+ cb(bres, cbpw);
}
}
-static void gui_cert_verify(nsurl *url, const struct ssl_cert_info *certs,
- unsigned long num, nserror (*cb)(bool proceed, void *pw),
- void *cbpw)
+static void
+gui_cert_verify(nsurl *url, const struct ssl_cert_info *certs,
+ unsigned long num, nserror (*cb)(bool proceed, void *pw),
+ void *cbpw)
{
- struct sslcert_session_data *data;
+ struct sslcert_session_data *data;
LOG((""));
// TODO: localize string
int b = form_alert(1, "[2][SSL Verify failed, continue?][Continue|Abort|Details...]");
if(b == 1){
- // Accept
- urldb_set_cert_permissions(url, true);
- cb(true, cbpw);
+ // Accept
+ urldb_set_cert_permissions(url, true);
+ cb(true, cbpw);
} else if(b == 2) {
// Reject
- urldb_set_cert_permissions(url, false);
- cb(false, cbpw);
+ urldb_set_cert_permissions(url, false);
+ cb(false, cbpw);
} else if(b == 3) {
// Inspect
sslcert_viewer_create_session_data(num, url, cb, cbpw, certs,
- &data);
- atari_sslcert_viewer_open(data);
+ &data);
+ atari_sslcert_viewer_open(data);
}
}
@@ -758,7 +809,7 @@ void gui_set_input_gui_window(struct gui_window *gw)
struct gui_window * gui_get_input_window(void)
{
- return(input_window);
+ return(input_window);
}
static void gui_quit(void)
@@ -768,25 +819,25 @@ static void gui_quit(void)
struct gui_window * gw = window_list;
struct gui_window * tmp = window_list;
- /* Destroy all remaining browser windows: */
+ /* Destroy all remaining browser windows: */
while (gw) {
- tmp = gw->next;
- browser_window_destroy(gw->browser->bw);
- gw = tmp;
+ tmp = gw->next;
+ browser_window_destroy(gw->browser->bw);
+ gw = tmp;
}
- /* destroy the treeview windows: */
+ /* destroy the treeview windows: */
atari_global_history_destroy();
atari_hotlist_destroy();
atari_cookie_manager_destroy();
- /* shutdown netsurf treeview framework: */
+ /* shutdown netsurf treeview framework: */
treeview_fini();
- /* shutdown the toolbar framework: */
+ /* shutdown the toolbar framework: */
toolbar_exit();
- /* save persistent informations: */
+ /* save persistent informations: */
urldb_save_cookies(nsoption_charp(cookie_file));
urldb_save(nsoption_charp(url_file));
@@ -800,9 +851,9 @@ static void gui_quit(void)
LOG(("done"));
}
-
-
-
+/**
+ * Process commandline parameters.
+ */
static bool
process_cmdline(int argc, char** argv)
{
@@ -813,69 +864,69 @@ process_cmdline(int argc, char** argv)
if ((nsoption_int(window_width) != 0) && (nsoption_int(window_height) != 0)) {
- option_window_width = nsoption_int(window_width);
- option_window_height = nsoption_int(window_height);
- option_window_x = nsoption_int(window_x);
- option_window_y = nsoption_int(window_y);
+ option_window_width = nsoption_int(window_width);
+ option_window_height = nsoption_int(window_height);
+ option_window_x = nsoption_int(window_x);
+ option_window_y = nsoption_int(window_y);
- if (option_window_width <= desk_area.g_w
- && option_window_height < desk_area.g_h) {
- set_default_dimensions = false;
- }
+ if (option_window_width <= desk_area.g_w
+ && option_window_height < desk_area.g_h) {
+ set_default_dimensions = false;
+ }
}
if (set_default_dimensions) {
- if( sys_type() == SYS_TOS ) {
- /* on single tasking OS, start as fulled window: */
- option_window_width = desk_area.g_w;
- option_window_height = desk_area.g_h;
- option_window_x = desk_area.g_w/2-(option_window_width/2);
- option_window_y = (desk_area.g_h/2)-(option_window_height/2);
- } else {
- option_window_width = 600;
- option_window_height = 360;
- option_window_x = 10;
- option_window_y = 30;
- }
+ if( sys_type() == SYS_TOS ) {
+ /* on single tasking OS, start as fulled window: */
+ option_window_width = desk_area.g_w;
+ option_window_height = desk_area.g_h;
+ option_window_x = desk_area.g_w/2-(option_window_width/2);
+ option_window_y = (desk_area.g_h/2)-(option_window_height/2);
+ } else {
+ option_window_width = 600;
+ option_window_height = 360;
+ option_window_x = 10;
+ option_window_y = 30;
+ }
}
if (nsoption_charp(homepage_url) != NULL)
- option_homepage_url = nsoption_charp(homepage_url);
+ option_homepage_url = nsoption_charp(homepage_url);
else
- option_homepage_url = NETSURF_HOMEPAGE;
+ option_homepage_url = NETSURF_HOMEPAGE;
while((opt = getopt(argc, argv, "w:h:")) != -1) {
- switch (opt) {
- case 'w':
- option_window_width = atoi(optarg);
- break;
-
- case 'h':
- option_window_height = atoi(optarg);
- break;
-
- default:
- fprintf(stderr,
- "Usage: %s [w,h,v] url\n",
- argv[0]);
- return false;
- }
+ switch (opt) {
+ case 'w':
+ option_window_width = atoi(optarg);
+ break;
+
+ case 'h':
+ option_window_height = atoi(optarg);
+ break;
+
+ default:
+ fprintf(stderr,
+ "Usage: %s [w,h,v] url\n",
+ argv[0]);
+ return false;
+ }
}
if (optind < argc) {
- option_homepage_url = argv[optind];
+ option_homepage_url = argv[optind];
}
return true;
}
static inline void create_cursor(int flags, short mode, void * form,
- MFORM_EX * m)
+ MFORM_EX * m)
{
m->flags = flags;
m->number = mode;
if( flags & MFORM_EX_FLAG_USERFORM ) {
- m->number = mode;
- m->tree = (OBJECT*)form;
+ m->number = mode;
+ m->tree = (OBJECT*)form;
}
}
@@ -902,7 +953,7 @@ static nserror set_defaults(struct nsoption_s *defaults)
/* Set defaults for absent option strings */
nsoption_setnull_charp(cookie_file, strdup("cookies"));
if (nsoption_charp(cookie_file) == NULL) {
- LOG(("Failed initialising string options"));
+ LOG(("Failed initialising string options"));
return NSERROR_BAD_PARAMETER;
}
return NSERROR_OK;
@@ -917,10 +968,10 @@ static void gui_init(int argc, char** argv)
LOG(("Using RSC file: %s ", (char*)&buf));
if (rsrc_load(buf)==0) {
- char msg[1024];
+ char msg[1024];
- snprintf(msg, 1024, "Unable to open GEM Resource file (%s)!", buf);
- die(msg);
+ snprintf(msg, 1024, "Unable to open GEM Resource file (%s)!", buf);
+ die(msg);
}
wind_get_grect(0, WF_WORKXYWH, &desk_area);
@@ -935,36 +986,36 @@ static void gui_init(int argc, char** argv)
create_cursor(0, OUTLN_CROSS, NULL, &gem_cursors.sizenwse);
cursors = gemtk_obj_get_tree(CURSOR);
create_cursor(MFORM_EX_FLAG_USERFORM, CURSOR_APPSTART,
- cursors, &gem_cursors.appstarting);
+ cursors, &gem_cursors.appstarting);
gem_set_cursor( &gem_cursors.appstarting );
create_cursor(MFORM_EX_FLAG_USERFORM, CURSOR_SIZEWE,
- cursors, &gem_cursors.sizewe);
+ cursors, &gem_cursors.sizewe);
create_cursor(MFORM_EX_FLAG_USERFORM, CURSOR_SIZENS,
- cursors, &gem_cursors.sizens);
+ cursors, &gem_cursors.sizens);
create_cursor(MFORM_EX_FLAG_USERFORM, CURSOR_NODROP,
- cursors, &gem_cursors.nodrop);
+ cursors, &gem_cursors.nodrop);
create_cursor(MFORM_EX_FLAG_USERFORM, CURSOR_DENY,
- cursors, &gem_cursors.deny);
+ cursors, &gem_cursors.deny);
create_cursor(MFORM_EX_FLAG_USERFORM, CURSOR_MENU,
- cursors, &gem_cursors.menu);
+ cursors, &gem_cursors.menu);
create_cursor(MFORM_EX_FLAG_USERFORM, CURSOR_HELP,
- cursors, &gem_cursors.help);
+ cursors, &gem_cursors.help);
LOG(("Enabling core select menu"));
nsoption_set_bool(core_select_menu, true);
LOG(("Loading url.db from: %s", nsoption_charp(url_file) ));
if( strlen(nsoption_charp(url_file)) ) {
- urldb_load(nsoption_charp(url_file));
+ urldb_load(nsoption_charp(url_file));
}
LOG(("Loading cookies from: %s", nsoption_charp(cookie_file) ));
if( strlen(nsoption_charp(cookie_file)) ) {
- urldb_load_cookies(nsoption_charp(cookie_file));
+ urldb_load_cookies(nsoption_charp(cookie_file));
}
if (process_cmdline(argc,argv) != true)
- die("unable to process command line.\n");
+ die("unable to process command line.\n");
LOG(("Initializing NKC..."));
nkc_init();
@@ -985,14 +1036,14 @@ static void gui_init2(int argc, char** argv)
deskmenu_init();
menu_register( -1, theapp);
if (sys_type() & (SYS_MAGIC|SYS_NAES|SYS_XAAES)) {
- menu_register( _AESapid, (char*)" NetSurf ");
+ menu_register( _AESapid, (char*)" NetSurf ");
}
gemtk_wm_init();
/* Initialize the netsurf treeview framework with default font size: */
treeview_init(0);
- /* Initialize the specific treeview windows: */
+ /* Initialize the specific treeview windows: */
atari_global_history_init();
atari_hotlist_init();
atari_cookie_manager_init();
@@ -1062,7 +1113,7 @@ int main(int argc, char** argv)
nserror ret;
struct netsurf_table atari_table = {
- .browser = &atari_browser_table,
+ .browser = &atari_browser_table,
.window = &atari_window_table,
.clipboard = &atari_clipboard_table,
.download = atari_download_table,
@@ -1070,12 +1121,12 @@ int main(int argc, char** argv)
.file = atari_file_table,
.utf8 = atari_utf8_table,
.search = atari_search_table,
- .llcache = filesystem_llcache_table
+ .llcache = filesystem_llcache_table
};
ret = netsurf_register(&atari_table);
if (ret != NSERROR_OK) {
- die("NetSurf operation table failed registration");
+ die("NetSurf operation table failed registration");
}
/** @todo logging file descriptor update belongs in a nslog_init callback */
@@ -1104,7 +1155,7 @@ int main(int argc, char** argv)
/* user options setup */
ret = nsoption_init(set_defaults, &nsoptions, &nsoptions_default);
if (ret != NSERROR_OK) {
- die("Options failed to initialise");
+ die("Options failed to initialise");
}
nsoption_read(options, NULL);
nsoption_commandline(&argc, argv, NULL);
@@ -1127,10 +1178,10 @@ int main(int argc, char** argv)
LOG(("Creating initial browser window..."));
addr = option_homepage_url;
if (strncmp(addr, "file://", 7) && strncmp(addr, "http://", 7)) {
- if (stat(addr, &stat_buf) == 0) {
- file_url = local_file_to_url(addr);
- addr = file_url;
- }
+ if (stat(addr, &stat_buf) == 0) {
+ file_url = local_file_to_url(addr);
+ addr = file_url;
+ }
}
/* create an initial browser window */
@@ -1158,9 +1209,8 @@ int main(int argc, char** argv)
fclose(stdout);
fclose(stderr);
#endif
- LOG(("exit_gem"));
+ LOG(("exit_gem"));
exit_gem();
return 0;
}
-
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=09509a90956ffb60105...
commit 09509a90956ffb60105271fbee178897862b6d3b
Author: Vincent Sanders <vince(a)kyllikki.org>
Commit: Vincent Sanders <vince(a)kyllikki.org>
Some minor documentation cleanups to reduce doxygen warnings
diff --git a/desktop/gui.h b/desktop/gui.h
index 21dd85e..4dc638c 100644
--- a/desktop/gui.h
+++ b/desktop/gui.h
@@ -106,8 +106,10 @@ struct gui_window_table {
/**
* Destroy previously created gui window
+ *
+ * \param gw The gui window to destroy.
*/
- void (*destroy)(struct gui_window *g);
+ void (*destroy)(struct gui_window *gw);
/**
* Force a redraw of the entire contents of a window.
@@ -193,12 +195,20 @@ struct gui_window_table {
void (*set_title)(struct gui_window *g, const char *title);
/**
- * set the navigation url.
+ * Set the navigation url.
+ *
+ * \param gw window to update.
+ * \param url The url to use as icon.
*/
- void (*set_url)(struct gui_window *g, const char *url);
+ void (*set_url)(struct gui_window *gw, const char *url);
- /** set favicon */
- void (*set_icon)(struct gui_window *g, struct hlcache_handle *icon);
+ /**
+ * Set a favicon for a gui window.
+ *
+ * \param gw window to update.
+ * \param icon handle to object to use as icon.
+ */
+ void (*set_icon)(struct gui_window *gw, struct hlcache_handle *icon);
/**
* Set the status bar of a browser window.
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=265f63e67968cfcc23e...
commit 265f63e67968cfcc23e785fe7b8b38a7961572f1
Author: Vincent Sanders <vince(a)kyllikki.org>
Commit: Vincent Sanders <vince(a)kyllikki.org>
remove use of deprecated netsurf_quit variable
The core no longer needs to run the event polling loop as fetches are now
scheduler driven. This is part of a series which will ultimately remove
netsurf_poll callback altogether.
The Amiga maintainer probably wants to look at moving the ami_quit
signalling inside ami_handle_msg() to further reduce overhead.
diff --git a/amiga/gui.c b/amiga/gui.c
index f833081..c01e294 100644
--- a/amiga/gui.c
+++ b/amiga/gui.c
@@ -150,6 +150,8 @@
#define EXTRADOWN (IECODE_5TH_BUTTON)
#define EXTRAUP (IECODE_5TH_BUTTON | IECODE_UP_PREFIX)
+static bool ami_quit = false;
+
extern struct gui_utf8_table *amiga_utf8_table;
struct ami_gui_tb_userdata {
@@ -973,7 +975,7 @@ static void gui_init2(int argc, char** argv)
IDoMethod(arexx_obj,AM_EXECUTE,sendcmd,"NETSURF",NULL,NULL,NULL,NULL);
FreeVec(sendcmd);
- netsurf_quit=true;
+ ami_quit=true;
return;
}
@@ -2502,12 +2504,6 @@ void ami_get_msg(void)
ami_quit_netsurf_delayed();
}
-
-static void gui_poll(bool active)
-{
- ami_get_msg();
-}
-
void ami_change_tab(struct gui_window_2 *gwin, int direction)
{
struct Node *tab_node = gwin->bw->window->tab_node;
@@ -2629,7 +2625,7 @@ void ami_quit_netsurf(void)
if(IsMinListEmpty(window_list)) {
/* last window closed, so exit */
- netsurf_quit = true;
+ ami_quit = true;
}
}
@@ -2696,7 +2692,7 @@ void ami_try_quit(void)
if(nsoption_bool(close_no_quit) == false)
{
- netsurf_quit = true;
+ ami_quit = true;
return;
}
else
@@ -5109,7 +5105,6 @@ static struct gui_search_web_table amiga_search_web_table = {
};
static struct gui_browser_table amiga_browser_table = {
- .poll = gui_poll,
.schedule = ami_schedule,
.quit = gui_quit,
@@ -5224,7 +5219,9 @@ int main(int argc, char** argv)
AddPart(script, nsoption_charp(arexx_startup), 1024);
ami_arexx_execute(script);
- netsurf_main_loop();
+ while (!ami_quit) {
+ ami_get_msg();
+ }
strlcpy(script, nsoption_charp(arexx_dir), 1024);
AddPart(script, nsoption_charp(arexx_shutdown), 1024);
-----------------------------------------------------------------------
Summary of changes:
amiga/gui.c | 19 +-
atari/gui.c | 735 ++++++++++++++++++++++++++++++--------------------------
desktop/gui.h | 20 +-
windows/gui.c | 50 ++--
windows/gui.h | 4 +
windows/main.c | 6 +-
6 files changed, 451 insertions(+), 383 deletions(-)
diff --git a/amiga/gui.c b/amiga/gui.c
index f833081..c01e294 100644
--- a/amiga/gui.c
+++ b/amiga/gui.c
@@ -150,6 +150,8 @@
#define EXTRADOWN (IECODE_5TH_BUTTON)
#define EXTRAUP (IECODE_5TH_BUTTON | IECODE_UP_PREFIX)
+static bool ami_quit = false;
+
extern struct gui_utf8_table *amiga_utf8_table;
struct ami_gui_tb_userdata {
@@ -973,7 +975,7 @@ static void gui_init2(int argc, char** argv)
IDoMethod(arexx_obj,AM_EXECUTE,sendcmd,"NETSURF",NULL,NULL,NULL,NULL);
FreeVec(sendcmd);
- netsurf_quit=true;
+ ami_quit=true;
return;
}
@@ -2502,12 +2504,6 @@ void ami_get_msg(void)
ami_quit_netsurf_delayed();
}
-
-static void gui_poll(bool active)
-{
- ami_get_msg();
-}
-
void ami_change_tab(struct gui_window_2 *gwin, int direction)
{
struct Node *tab_node = gwin->bw->window->tab_node;
@@ -2629,7 +2625,7 @@ void ami_quit_netsurf(void)
if(IsMinListEmpty(window_list)) {
/* last window closed, so exit */
- netsurf_quit = true;
+ ami_quit = true;
}
}
@@ -2696,7 +2692,7 @@ void ami_try_quit(void)
if(nsoption_bool(close_no_quit) == false)
{
- netsurf_quit = true;
+ ami_quit = true;
return;
}
else
@@ -5109,7 +5105,6 @@ static struct gui_search_web_table amiga_search_web_table = {
};
static struct gui_browser_table amiga_browser_table = {
- .poll = gui_poll,
.schedule = ami_schedule,
.quit = gui_quit,
@@ -5224,7 +5219,9 @@ int main(int argc, char** argv)
AddPart(script, nsoption_charp(arexx_startup), 1024);
ami_arexx_execute(script);
- netsurf_main_loop();
+ while (!ami_quit) {
+ ami_get_msg();
+ }
strlcpy(script, nsoption_charp(arexx_dir), 1024);
AddPart(script, nsoption_charp(arexx_shutdown), 1024);
diff --git a/atari/gui.c b/atari/gui.c
index a209866..d516ee4 100644
--- a/atari/gui.c
+++ b/atari/gui.c
@@ -17,7 +17,9 @@
*/
/**
- * \file Provides all the mandatory functions prefixed with gui_ for atari
+ * \file
+ *
+ * Provides all the mandatory functions prefixed with gui_ for atari
*/
#include <sys/types.h>
@@ -75,16 +77,15 @@
#include "atari/filetype.h"
#include "cflib.h"
-#define TODO() (0)/*printf("%s Unimplemented!\n", __FUNCTION__)*/
+static bool atari_quit = false;
struct gui_window *input_window = NULL;
struct gui_window *window_list = NULL;
-void * h_gem_rsrc;
+void *h_gem_rsrc;
long next_poll;
bool rendering = false;
GRECT desk_area;
-
/* Comandline / Options: */
int option_window_width;
int option_window_height;
@@ -92,7 +93,7 @@ int option_window_x;
int option_window_y;
/* Defaults to option_homepage_url, commandline options overwrites that value */
-const char * option_homepage_url;
+const char *option_homepage_url;
/* path to choices file: */
char options[PATH_MAX];
@@ -115,26 +116,29 @@ short aes_msg_out[8];
bool gui_window_get_scroll(struct gui_window *w, int *sx, int *sy);
static void gui_window_set_url(struct gui_window *w, const char *url);
-static void gui_poll(bool active)
+/**
+ * Core atari event processing.
+ */
+static void atari_poll(void)
{
- struct gui_window *tmp;
+ struct gui_window *tmp;
short mx, my, dummy;
aes_event_in.emi_tlow = schedule_run();
if(rendering){
- aes_event_in.emi_tlow = nsoption_int(atari_gui_poll_timeout);
- }
+ aes_event_in.emi_tlow = nsoption_int(atari_gui_poll_timeout);
+ }
if(aes_event_in.emi_tlow < 0) {
- aes_event_in.emi_tlow = 10000;
- printf("long poll!\n");
+ aes_event_in.emi_tlow = 10000;
+ printf("long poll!\n");
}
- if(input_window && input_window->root->redraw_slots.areas_used > 0) {
- window_process_redraws(input_window->root);
- }
+ if(input_window && input_window->root->redraw_slots.areas_used > 0) {
+ window_process_redraws(input_window->root);
+ }
graf_mkstate(&mx, &my, &dummy, &dummy);
@@ -142,136 +146,161 @@ static void gui_poll(bool active)
aes_event_in.emi_m1.g_y = my;
evnt_multi_fast(&aes_event_in, aes_msg_out, &aes_event_out);
if(gemtk_wm_dispatch_event(&aes_event_in, &aes_event_out, aes_msg_out) == 0) {
- if( (aes_event_out.emo_events & MU_MESAG) != 0 ) {
- LOG(("WM: %d\n", aes_msg_out[0]));
- switch(aes_msg_out[0]) {
-
- case MN_SELECTED:
- LOG(("Menu Item: %d\n",aes_msg_out[4]));
- deskmenu_dispatch_item(aes_msg_out[3], aes_msg_out[4]);
- break;
-
- case AP_TERM:
- netsurf_quit = true;
- break;
- default:
- break;
- }
- }
- if((aes_event_out.emo_events & MU_KEYBD) != 0) {
- uint16_t nkc = gem_to_norm( (short)aes_event_out.emo_kmeta,
- (short)aes_event_out.emo_kreturn);
- deskmenu_dispatch_keypress(aes_event_out.emo_kreturn,
- aes_event_out.emo_kmeta, nkc);
- }
+ if( (aes_event_out.emo_events & MU_MESAG) != 0 ) {
+ LOG(("WM: %d\n", aes_msg_out[0]));
+ switch(aes_msg_out[0]) {
+
+ case MN_SELECTED:
+ LOG(("Menu Item: %d\n",aes_msg_out[4]));
+ deskmenu_dispatch_item(aes_msg_out[3], aes_msg_out[4]);
+ break;
+
+ case AP_TERM:
+ atari_quit = true;
+ break;
+ default:
+ break;
+ }
+ }
+ if((aes_event_out.emo_events & MU_KEYBD) != 0) {
+ uint16_t nkc = gem_to_norm( (short)aes_event_out.emo_kmeta,
+ (short)aes_event_out.emo_kreturn);
+ deskmenu_dispatch_keypress(aes_event_out.emo_kreturn,
+ aes_event_out.emo_kmeta, nkc);
+ }
}
tmp = window_list;
while(tmp){
- if(tmp->root->redraw_slots.areas_used > 0){
- window_process_redraws(tmp->root);
- }
- tmp = tmp->next;
+ if(tmp->root->redraw_slots.areas_used > 0){
+ window_process_redraws(tmp->root);
+ }
+ tmp = tmp->next;
}
- // TODO: implement generic treeview redraw function
- // TODO: rename hl to atari_hotlist or create getter for it...
-
- atari_treeview_flush_redraws();
+ /** @todo implement generic treeview redraw function. */
+ /** @todo rename hl to atari_hotlist or create getter for it... */
+ atari_treeview_flush_redraws();
}
-
+/**
+ * Create and open a gui window for a browsing context.
+ *
+ * \param bw bw to create gui_window for
+ * \param existing an existing gui_window, may be NULL
+ * \param flags flags for gui window creation
+ * \return gui window, or NULL on error
+ *
+ * If GW_CREATE_CLONE flag is set existing is non-NULL.
+ *
+ * The created gui_window must include a reference to the browser
+ * window passed in the bw param.
+ */
static struct gui_window *
gui_window_create(struct browser_window *bw,
- struct gui_window *existing,
- gui_window_create_flags flags) {
+ struct gui_window *existing,
+ gui_window_create_flags flags)
+{
struct gui_window *gw=NULL;
LOG(( "gw: %p, BW: %p, existing %p, flags: %d\n" , gw, bw, existing,
- (int)flags
- ));
+ (int)flags
+ ));
gw = calloc(1, sizeof(struct gui_window));
if (gw == NULL)
- return NULL;
+ return NULL;
LOG(("new window: %p, bw: %p\n", gw, bw));
window_create(gw, bw, existing, WIDGET_STATUSBAR|WIDGET_TOOLBAR|WIDGET_RESIZE\
- |WIDGET_SCROLL);
+ |WIDGET_SCROLL);
if (gw->root->win) {
- GRECT pos = {
- option_window_x, option_window_y,
- option_window_width, option_window_height
- };
- gui_window_set_url(gw, "");
- gui_window_set_pointer(gw, BROWSER_POINTER_DEFAULT);
- gui_set_input_gui_window(gw);
- window_open(gw->root, gw, pos);
+ GRECT pos = {
+ option_window_x, option_window_y,
+ option_window_width, option_window_height
+ };
+ gui_window_set_url(gw, "");
+ gui_window_set_pointer(gw, BROWSER_POINTER_DEFAULT);
+ gui_set_input_gui_window(gw);
+ window_open(gw->root, gw, pos);
}
/* add the window to the window list: */
if( window_list == NULL ) {
- window_list = gw;
- gw->next = NULL;
- gw->prev = NULL;
+ window_list = gw;
+ gw->next = NULL;
+ gw->prev = NULL;
} else {
- struct gui_window * tmp = window_list;
- while( tmp->next != NULL ) {
- tmp = tmp->next;
- }
- tmp->next = gw;
- gw->prev = tmp;
- gw->next = NULL;
+ struct gui_window * tmp = window_list;
+ while( tmp->next != NULL ) {
+ tmp = tmp->next;
+ }
+ tmp->next = gw;
+ gw->prev = tmp;
+ gw->next = NULL;
}
return( gw );
}
-void gui_window_destroy(struct gui_window *w)
+/**
+ * Destroy previously created gui window
+ *
+ * \param gw The gui window to destroy.
+ */
+void gui_window_destroy(struct gui_window *gw)
{
- if (w == NULL)
- return;
+ if (gw == NULL)
+ return;
LOG(("%s\n", __FUNCTION__ ));
- if (input_window == w) {
- gui_set_input_gui_window(NULL);
+ if (input_window == gw) {
+ gui_set_input_gui_window(NULL);
}
- nsatari_search_session_destroy(w->search);
- free(w->browser);
- free(w->status);
- free(w->title);
- free(w->url);
+ nsatari_search_session_destroy(gw->search);
+ free(gw->browser);
+ free(gw->status);
+ free(gw->title);
+ free(gw->url);
/* unlink the window: */
- if(w->prev != NULL ) {
- w->prev->next = w->next;
+ if(gw->prev != NULL ) {
+ gw->prev->next = gw->next;
} else {
- window_list = w->next;
+ window_list = gw->next;
}
- if( w->next != NULL ) {
- w->next->prev = w->prev;
+ if( gw->next != NULL ) {
+ gw->next->prev = gw->prev;
}
- window_unref_gui_window(w->root, w);
+ window_unref_gui_window(gw->root, gw);
- free(w);
- w = NULL;
+ free(gw);
+ gw = NULL;
if(input_window == NULL) {
- w = window_list;
- while( w != NULL ) {
- if(w->root) {
- gui_set_input_gui_window(w);
- break;
- }
- w = w->next;
- }
+ gw = window_list;
+ while( gw != NULL ) {
+ if(gw->root) {
+ gui_set_input_gui_window(w);
+ break;
+ }
+ gw = gw->next;
+ }
}
}
+/**
+ * Find the current dimensions of a browser window's content area.
+ *
+ * \param w gui_window to measure
+ * \param width receives width of window
+ * \param height receives height of window
+ * \param scaled whether to return scaled values
+ */
static void
gui_window_get_dimensions(struct gui_window *w,
int *width,
@@ -279,69 +308,77 @@ gui_window_get_dimensions(struct gui_window *w,
bool scaled)
{
if (w == NULL)
- return;
+ return;
GRECT rect;
window_get_grect(w->root, BROWSER_AREA_CONTENT, &rect);
*width = rect.g_w;
*height = rect.g_h;
}
+/**
+ * Set the title of a window.
+ *
+ * \param gw window to update
+ * \param title new window title
+ */
static void gui_window_set_title(struct gui_window *gw, const char *title)
{
-
if (gw == NULL)
- return;
+ return;
if (gw->root) {
- int l;
- char * conv;
- l = strlen(title)+1;
- if (utf8_to_local_encoding(title, l-1, &conv) == NSERROR_OK ) {
- l = MIN((uint32_t)atari_sysinfo.aes_max_win_title_len, strlen(conv));
- if(gw->title == NULL)
- gw->title = malloc(l);
- else
- gw->title = realloc(gw->title, l);
-
- strncpy(gw->title, conv, l);
- free( conv );
- } else {
- l = MIN((size_t)atari_sysinfo.aes_max_win_title_len, strlen(title));
- if(gw->title == NULL)
- gw->title = malloc(l);
- else
- gw->title = realloc(gw->title, l);
- strncpy(gw->title, title, l);
- }
- gw->title[l] = 0;
- if(input_window == gw)
- window_set_title(gw->root, gw->title);
+ int l;
+ char * conv;
+ l = strlen(title)+1;
+ if (utf8_to_local_encoding(title, l-1, &conv) == NSERROR_OK ) {
+ l = MIN((uint32_t)atari_sysinfo.aes_max_win_title_len, strlen(conv));
+ if(gw->title == NULL)
+ gw->title = malloc(l);
+ else
+ gw->title = realloc(gw->title, l);
+
+ strncpy(gw->title, conv, l);
+ free( conv );
+ } else {
+ l = MIN((size_t)atari_sysinfo.aes_max_win_title_len, strlen(title));
+ if(gw->title == NULL)
+ gw->title = malloc(l);
+ else
+ gw->title = realloc(gw->title, l);
+ strncpy(gw->title, title, l);
+ }
+ gw->title[l] = 0;
+ if(input_window == gw)
+ window_set_title(gw->root, gw->title);
}
}
/**
- * set the status bar message
+ * Set the status bar of a browser window.
+ *
+ * \param w gui_window to update
+ * \param text new status text
*/
void gui_window_set_status(struct gui_window *w, const char *text)
{
int l;
if (w == NULL || text == NULL)
- return;
+ return;
assert(w->root);
l = strlen(text)+1;
if(w->status == NULL)
- w->status = malloc(l);
+ w->status = malloc(l);
else
- w->status = realloc(w->status, l);
+ w->status = realloc(w->status, l);
strncpy(w->status, text, l);
w->status[l] = 0;
if(input_window == w)
- window_set_stauts(w->root, (char*)text);
+ window_set_stauts(w->root, (char*)text);
}
static void atari_window_reformat(struct gui_window *gw)
@@ -359,7 +396,7 @@ static void gui_window_redraw_window(struct gui_window *gw)
CMP_BROWSER b;
GRECT rect;
if (gw == NULL)
- return;
+ return;
b = gw->browser;
window_get_grect(gw->root, BROWSER_AREA_CONTENT, &rect);
window_schedule_redraw_grect(gw->root, &rect);
@@ -371,7 +408,7 @@ static void gui_window_update_box(struct gui_window *gw, const struct rect *rect
struct gemtk_wm_scroll_info_s *slid;
if (gw == NULL)
- return;
+ return;
slid = gemtk_wm_get_scroll_info(gw->root->win);
@@ -387,7 +424,7 @@ static void gui_window_update_box(struct gui_window *gw, const struct rect *rect
bool gui_window_get_scroll(struct gui_window *w, int *sx, int *sy)
{
if (w == NULL)
- return false;
+ return false;
window_get_scroll(w->root, sx, sy);
@@ -397,9 +434,9 @@ bool gui_window_get_scroll(struct gui_window *w, int *sx, int *sy)
static void gui_window_set_scroll(struct gui_window *w, int sx, int sy)
{
if ( (w == NULL)
- || (w->browser->bw == NULL)
- || (!browser_window_has_content(w->browser->bw)))
- return;
+ || (w->browser->bw == NULL)
+ || (!browser_window_has_content(w->browser->bw)))
+ return;
LOG(("scroll (gui_window: %p) %d, %d\n", w, sx, sy));
window_scroll_by(w->root, sx, sy);
@@ -407,25 +444,31 @@ static void gui_window_set_scroll(struct gui_window *w, int sx, int sy)
}
-/* It seems this method is called when content size got adjusted,
- so that we can adjust scroll info. We also have to call it when tab
- change occurs.
-*/
+/**
+ * Update the extent of the inside of a browser window to that of the
+ * current content.
+ *
+ * It seems this method is called when content size got adjusted, so
+ * that we can adjust scroll info. We also have to call it when tab
+ * change occurs.
+ *
+ * \param gw gui_window to update the extent of
+ */
static void gui_window_update_extent(struct gui_window *gw)
{
- if(browser_window_has_content(gw->browser->bw)) {
- // TODO: store content size!
- if(window_get_active_gui_window(gw->root) == gw) {
- window_set_content_size( gw->root,
- content_get_width(gw->browser->bw->current_content),
- content_get_height(gw->browser->bw->current_content)
- );
- window_update_back_forward(gw->root);
- GRECT area;
- window_get_grect(gw->root, BROWSER_AREA_CONTENT, &area);
- window_schedule_redraw_grect(gw->root, &area);
- }
+ if(browser_window_has_content(gw->browser->bw)) {
+ /** @todo store content size. */
+ if(window_get_active_gui_window(gw->root) == gw) {
+ window_set_content_size( gw->root,
+ content_get_width(gw->browser->bw->current_content),
+ content_get_height(gw->browser->bw->current_content)
+ );
+ window_update_back_forward(gw->root);
+ GRECT area;
+ window_get_grect(gw->root, BROWSER_AREA_CONTENT, &area);
+ window_schedule_redraw_grect(gw->root, &area);
+ }
}
}
@@ -436,76 +479,76 @@ static void gui_window_update_extent(struct gui_window *gw)
void gui_window_set_pointer(struct gui_window *gw, gui_pointer_shape shape)
{
if (gw == NULL)
- return;
+ return;
switch (shape) {
case GUI_POINTER_POINT: /* link */
- gw->cursor = &gem_cursors.hand;
- break;
+ gw->cursor = &gem_cursors.hand;
+ break;
case GUI_POINTER_MENU:
- gw->cursor = &gem_cursors.menu;
- break;
+ gw->cursor = &gem_cursors.menu;
+ break;
case GUI_POINTER_CARET: /* input */
- gw->cursor = &gem_cursors.ibeam;
- break;
+ gw->cursor = &gem_cursors.ibeam;
+ break;
case GUI_POINTER_CROSS:
- gw->cursor = &gem_cursors.cross;
- break;
+ gw->cursor = &gem_cursors.cross;
+ break;
case GUI_POINTER_MOVE:
- gw->cursor = &gem_cursors.sizeall;
- break;
+ gw->cursor = &gem_cursors.sizeall;
+ break;
case GUI_POINTER_RIGHT:
case GUI_POINTER_LEFT:
- gw->cursor = &gem_cursors.sizewe;
- break;
+ gw->cursor = &gem_cursors.sizewe;
+ break;
case GUI_POINTER_UP:
case GUI_POINTER_DOWN:
- gw->cursor = &gem_cursors.sizens;
- break;
+ gw->cursor = &gem_cursors.sizens;
+ break;
case GUI_POINTER_RU:
case GUI_POINTER_LD:
- gw->cursor = &gem_cursors.sizenesw;
- break;
+ gw->cursor = &gem_cursors.sizenesw;
+ break;
case GUI_POINTER_RD:
case GUI_POINTER_LU:
- gw->cursor = &gem_cursors.sizenwse;
- break;
+ gw->cursor = &gem_cursors.sizenwse;
+ break;
case GUI_POINTER_WAIT:
- gw->cursor = &gem_cursors.wait;
- break;
+ gw->cursor = &gem_cursors.wait;
+ break;
case GUI_POINTER_PROGRESS:
- gw->cursor = &gem_cursors.appstarting;
- break;
+ gw->cursor = &gem_cursors.appstarting;
+ break;
case GUI_POINTER_NO_DROP:
- gw->cursor = &gem_cursors.nodrop;
- break;
+ gw->cursor = &gem_cursors.nodrop;
+ break;
case GUI_POINTER_NOT_ALLOWED:
- gw->cursor = &gem_cursors.deny;
- break;
+ gw->cursor = &gem_cursors.deny;
+ break;
case GUI_POINTER_HELP:
- gw->cursor = &gem_cursors.help;
- break;
+ gw->cursor = &gem_cursors.help;
+ break;
default:
- gw->cursor = &gem_cursors.arrow;
- break;
+ gw->cursor = &gem_cursors.arrow;
+ break;
}
if (input_window == gw) {
- gem_set_cursor(gw->cursor);
+ gem_set_cursor(gw->cursor);
}
}
@@ -515,36 +558,36 @@ static void gui_window_set_url(struct gui_window *w, const char *url)
int l;
if (w == NULL)
- return;
+ return;
l = strlen(url)+1;
if (w->url == NULL) {
- w->url = malloc(l);
+ w->url = malloc(l);
} else {
- w->url = realloc(w->url, l);
+ w->url = realloc(w->url, l);
}
strncpy(w->url, url, l);
w->url[l] = 0;
if(input_window == w->root->active_gui_window) {
- toolbar_set_url(w->root->toolbar, url);
+ toolbar_set_url(w->root->toolbar, url);
}
}
char * gui_window_get_url(struct gui_window *gw)
{
- if (gw == NULL) {
- return(NULL);
- }
- return(gw->url);
+ if (gw == NULL) {
+ return(NULL);
+ }
+ return(gw->url);
}
char * gui_window_get_title(struct gui_window *gw)
{
- if (gw == NULL) {
- return(NULL);
- }
- return(gw->title);
+ if (gw == NULL) {
+ return(NULL);
+ }
+ return(gw->title);
}
static void throbber_advance( void * data )
@@ -553,12 +596,12 @@ static void throbber_advance( void * data )
struct gui_window * gw = (struct gui_window *)data;
if (gw->root == NULL)
- return;
+ return;
if (gw->root->toolbar == NULL)
- return;
+ return;
if (gw->root->toolbar->throbber.running == false)
- return;
+ return;
toolbar_throbber_progress(gw->root->toolbar);
atari_schedule(1000, throbber_advance, gw );
@@ -567,7 +610,7 @@ static void throbber_advance( void * data )
static void gui_window_start_throbber(struct gui_window *w)
{
if (w == NULL)
- return;
+ return;
toolbar_set_throbber_state(w->root->toolbar, true);
atari_schedule(1000, throbber_advance, w );
@@ -577,9 +620,9 @@ static void gui_window_start_throbber(struct gui_window *w)
static void gui_window_stop_throbber(struct gui_window *w)
{
if (w == NULL)
- return;
+ return;
if (w->root->toolbar->throbber.running == false)
- return;
+ return;
atari_schedule(-1, throbber_advance, w);
@@ -588,9 +631,12 @@ static void gui_window_stop_throbber(struct gui_window *w)
rendering = false;
}
-/* Place caret in window */
-static void gui_window_place_caret(struct gui_window *w, int x, int y, int height,
- const struct rect *clip)
+/**
+ * Place caret in window
+ */
+static void
+gui_window_place_caret(struct gui_window *w, int x, int y, int height,
+ const struct rect *clip)
{
window_place_caret(w->root, 1, x, y, height, NULL);
w->root->caret.state |= CARET_STATE_ENABLED;
@@ -605,16 +651,22 @@ static void
gui_window_remove_caret(struct gui_window *w)
{
if (w == NULL)
- return;
+ return;
if ((w->root->caret.state & CARET_STATE_ENABLED) != 0) {
- //printf("gw hide caret\n");
- window_place_caret(w->root, 0, -1, -1, -1, NULL);
- w->root->caret.state &= ~CARET_STATE_ENABLED;
+ //printf("gw hide caret\n");
+ window_place_caret(w->root, 0, -1, -1, -1, NULL);
+ w->root->caret.state &= ~CARET_STATE_ENABLED;
}
return;
}
+/**
+ * Set a favicon for a gui window.
+ *
+ * \param g window to update.
+ * \param icon handle to object to use as icon.
+ */
static void
gui_window_set_icon(struct gui_window *g, hlcache_handle *icon)
{
@@ -623,7 +675,7 @@ gui_window_set_icon(struct gui_window *g, hlcache_handle *icon)
bmp_icon = (icon != NULL) ? content_get_bitmap(icon) : NULL;
g->icon = bmp_icon;
if(input_window == g) {
- window_set_icon(g->root, bmp_icon);
+ window_set_icon(g->root, bmp_icon);
}
}
@@ -653,27 +705,27 @@ static void gui_get_clipboard(char **buffer, size_t *length)
clip = scrap_txt_read();
if(clip == NULL) {
- return;
+ return;
} else {
- // clipboard is in atari encoding, convert it to utf8:
-
- size_t clip_len;
- char *utf8 = NULL;
-
- clip_len = strlen(clip);
- if (clip_len > 0) {
- nserror ret;
- ret = utf8_to_local_encoding(clip, clip_len, &utf8);
- if (ret == NSERROR_OK && utf8 != NULL) {
- *buffer = utf8;
- *length = strlen(utf8);
- } else {
- assert(ret == NSERROR_OK && utf8 != NULL);
- }
- }
+ // clipboard is in atari encoding, convert it to utf8:
+
+ size_t clip_len;
+ char *utf8 = NULL;
+
+ clip_len = strlen(clip);
+ if (clip_len > 0) {
+ nserror ret;
+ ret = utf8_to_local_encoding(clip, clip_len, &utf8);
+ if (ret == NSERROR_OK && utf8 != NULL) {
+ *buffer = utf8;
+ *length = strlen(utf8);
+ } else {
+ assert(ret == NSERROR_OK && utf8 != NULL);
+ }
+ }
- free(clip);
+ free(clip);
}
}
@@ -686,66 +738,67 @@ static void gui_get_clipboard(char **buffer, size_t *length)
* \param n_styles Number of text run styles in array
*/
static void gui_set_clipboard(const char *buffer, size_t length,
- nsclipboard_styles styles[], int n_styles)
+ nsclipboard_styles styles[], int n_styles)
{
if (length > 0 && buffer != NULL) {
- // convert utf8 input to atari encoding:
+ // convert utf8 input to atari encoding:
- nserror ret;
- char *clip = NULL;
+ nserror ret;
+ char *clip = NULL;
- ret = utf8_to_local_encoding(buffer,length, &clip);
- if (ret == NSERROR_OK) {
- scrap_txt_write(clip);
- } else {
- assert(ret == NSERROR_OK);
- }
- free(clip);
+ ret = utf8_to_local_encoding(buffer,length, &clip);
+ if (ret == NSERROR_OK) {
+ scrap_txt_write(clip);
+ } else {
+ assert(ret == NSERROR_OK);
+ }
+ free(clip);
}
}
static void gui_401login_open(nsurl *url, const char *realm,
- nserror (*cb)(bool proceed, void *pw), void *cbpw)
+ nserror (*cb)(bool proceed, void *pw), void *cbpw)
{
bool bres;
char * out = NULL;
bres = login_form_do( url, (char*)realm, &out);
if (bres) {
- LOG(("url: %s, realm: %s, auth: %s\n", url, realm, out ));
- urldb_set_auth_details(url, realm, out);
+ LOG(("url: %s, realm: %s, auth: %s\n", url, realm, out ));
+ urldb_set_auth_details(url, realm, out);
}
if (out != NULL) {
- free( out );
+ free( out );
}
if (cb != NULL) {
- cb(bres, cbpw);
+ cb(bres, cbpw);
}
}
-static void gui_cert_verify(nsurl *url, const struct ssl_cert_info *certs,
- unsigned long num, nserror (*cb)(bool proceed, void *pw),
- void *cbpw)
+static void
+gui_cert_verify(nsurl *url, const struct ssl_cert_info *certs,
+ unsigned long num, nserror (*cb)(bool proceed, void *pw),
+ void *cbpw)
{
- struct sslcert_session_data *data;
+ struct sslcert_session_data *data;
LOG((""));
// TODO: localize string
int b = form_alert(1, "[2][SSL Verify failed, continue?][Continue|Abort|Details...]");
if(b == 1){
- // Accept
- urldb_set_cert_permissions(url, true);
- cb(true, cbpw);
+ // Accept
+ urldb_set_cert_permissions(url, true);
+ cb(true, cbpw);
} else if(b == 2) {
// Reject
- urldb_set_cert_permissions(url, false);
- cb(false, cbpw);
+ urldb_set_cert_permissions(url, false);
+ cb(false, cbpw);
} else if(b == 3) {
// Inspect
sslcert_viewer_create_session_data(num, url, cb, cbpw, certs,
- &data);
- atari_sslcert_viewer_open(data);
+ &data);
+ atari_sslcert_viewer_open(data);
}
}
@@ -758,7 +811,7 @@ void gui_set_input_gui_window(struct gui_window *gw)
struct gui_window * gui_get_input_window(void)
{
- return(input_window);
+ return(input_window);
}
static void gui_quit(void)
@@ -768,25 +821,25 @@ static void gui_quit(void)
struct gui_window * gw = window_list;
struct gui_window * tmp = window_list;
- /* Destroy all remaining browser windows: */
+ /* Destroy all remaining browser windows: */
while (gw) {
- tmp = gw->next;
- browser_window_destroy(gw->browser->bw);
- gw = tmp;
+ tmp = gw->next;
+ browser_window_destroy(gw->browser->bw);
+ gw = tmp;
}
- /* destroy the treeview windows: */
+ /* destroy the treeview windows: */
atari_global_history_destroy();
atari_hotlist_destroy();
atari_cookie_manager_destroy();
- /* shutdown netsurf treeview framework: */
+ /* shutdown netsurf treeview framework: */
treeview_fini();
- /* shutdown the toolbar framework: */
+ /* shutdown the toolbar framework: */
toolbar_exit();
- /* save persistent informations: */
+ /* save persistent informations: */
urldb_save_cookies(nsoption_charp(cookie_file));
urldb_save(nsoption_charp(url_file));
@@ -800,9 +853,9 @@ static void gui_quit(void)
LOG(("done"));
}
-
-
-
+/**
+ * Process commandline parameters.
+ */
static bool
process_cmdline(int argc, char** argv)
{
@@ -813,69 +866,69 @@ process_cmdline(int argc, char** argv)
if ((nsoption_int(window_width) != 0) && (nsoption_int(window_height) != 0)) {
- option_window_width = nsoption_int(window_width);
- option_window_height = nsoption_int(window_height);
- option_window_x = nsoption_int(window_x);
- option_window_y = nsoption_int(window_y);
+ option_window_width = nsoption_int(window_width);
+ option_window_height = nsoption_int(window_height);
+ option_window_x = nsoption_int(window_x);
+ option_window_y = nsoption_int(window_y);
- if (option_window_width <= desk_area.g_w
- && option_window_height < desk_area.g_h) {
- set_default_dimensions = false;
- }
+ if (option_window_width <= desk_area.g_w
+ && option_window_height < desk_area.g_h) {
+ set_default_dimensions = false;
+ }
}
if (set_default_dimensions) {
- if( sys_type() == SYS_TOS ) {
- /* on single tasking OS, start as fulled window: */
- option_window_width = desk_area.g_w;
- option_window_height = desk_area.g_h;
- option_window_x = desk_area.g_w/2-(option_window_width/2);
- option_window_y = (desk_area.g_h/2)-(option_window_height/2);
- } else {
- option_window_width = 600;
- option_window_height = 360;
- option_window_x = 10;
- option_window_y = 30;
- }
+ if( sys_type() == SYS_TOS ) {
+ /* on single tasking OS, start as fulled window: */
+ option_window_width = desk_area.g_w;
+ option_window_height = desk_area.g_h;
+ option_window_x = desk_area.g_w/2-(option_window_width/2);
+ option_window_y = (desk_area.g_h/2)-(option_window_height/2);
+ } else {
+ option_window_width = 600;
+ option_window_height = 360;
+ option_window_x = 10;
+ option_window_y = 30;
+ }
}
if (nsoption_charp(homepage_url) != NULL)
- option_homepage_url = nsoption_charp(homepage_url);
+ option_homepage_url = nsoption_charp(homepage_url);
else
- option_homepage_url = NETSURF_HOMEPAGE;
+ option_homepage_url = NETSURF_HOMEPAGE;
while((opt = getopt(argc, argv, "w:h:")) != -1) {
- switch (opt) {
- case 'w':
- option_window_width = atoi(optarg);
- break;
-
- case 'h':
- option_window_height = atoi(optarg);
- break;
-
- default:
- fprintf(stderr,
- "Usage: %s [w,h,v] url\n",
- argv[0]);
- return false;
- }
+ switch (opt) {
+ case 'w':
+ option_window_width = atoi(optarg);
+ break;
+
+ case 'h':
+ option_window_height = atoi(optarg);
+ break;
+
+ default:
+ fprintf(stderr,
+ "Usage: %s [w,h,v] url\n",
+ argv[0]);
+ return false;
+ }
}
if (optind < argc) {
- option_homepage_url = argv[optind];
+ option_homepage_url = argv[optind];
}
return true;
}
static inline void create_cursor(int flags, short mode, void * form,
- MFORM_EX * m)
+ MFORM_EX * m)
{
m->flags = flags;
m->number = mode;
if( flags & MFORM_EX_FLAG_USERFORM ) {
- m->number = mode;
- m->tree = (OBJECT*)form;
+ m->number = mode;
+ m->tree = (OBJECT*)form;
}
}
@@ -902,12 +955,17 @@ static nserror set_defaults(struct nsoption_s *defaults)
/* Set defaults for absent option strings */
nsoption_setnull_charp(cookie_file, strdup("cookies"));
if (nsoption_charp(cookie_file) == NULL) {
- LOG(("Failed initialising string options"));
+ LOG(("Failed initialising string options"));
return NSERROR_BAD_PARAMETER;
}
return NSERROR_OK;
}
+static char *theapp = (char*)"NetSurf";
+
+/**
+ * Initialise atari gui.
+ */
static void gui_init(int argc, char** argv)
{
char buf[PATH_MAX];
@@ -917,10 +975,10 @@ static void gui_init(int argc, char** argv)
LOG(("Using RSC file: %s ", (char*)&buf));
if (rsrc_load(buf)==0) {
- char msg[1024];
+ char msg[1024];
- snprintf(msg, 1024, "Unable to open GEM Resource file (%s)!", buf);
- die(msg);
+ snprintf(msg, 1024, "Unable to open GEM Resource file (%s)!", buf);
+ die(msg);
}
wind_get_grect(0, WF_WORKXYWH, &desk_area);
@@ -935,41 +993,40 @@ static void gui_init(int argc, char** argv)
create_cursor(0, OUTLN_CROSS, NULL, &gem_cursors.sizenwse);
cursors = gemtk_obj_get_tree(CURSOR);
create_cursor(MFORM_EX_FLAG_USERFORM, CURSOR_APPSTART,
- cursors, &gem_cursors.appstarting);
+ cursors, &gem_cursors.appstarting);
gem_set_cursor( &gem_cursors.appstarting );
create_cursor(MFORM_EX_FLAG_USERFORM, CURSOR_SIZEWE,
- cursors, &gem_cursors.sizewe);
+ cursors, &gem_cursors.sizewe);
create_cursor(MFORM_EX_FLAG_USERFORM, CURSOR_SIZENS,
- cursors, &gem_cursors.sizens);
+ cursors, &gem_cursors.sizens);
create_cursor(MFORM_EX_FLAG_USERFORM, CURSOR_NODROP,
- cursors, &gem_cursors.nodrop);
+ cursors, &gem_cursors.nodrop);
create_cursor(MFORM_EX_FLAG_USERFORM, CURSOR_DENY,
- cursors, &gem_cursors.deny);
+ cursors, &gem_cursors.deny);
create_cursor(MFORM_EX_FLAG_USERFORM, CURSOR_MENU,
- cursors, &gem_cursors.menu);
+ cursors, &gem_cursors.menu);
create_cursor(MFORM_EX_FLAG_USERFORM, CURSOR_HELP,
- cursors, &gem_cursors.help);
+ cursors, &gem_cursors.help);
LOG(("Enabling core select menu"));
nsoption_set_bool(core_select_menu, true);
LOG(("Loading url.db from: %s", nsoption_charp(url_file) ));
if( strlen(nsoption_charp(url_file)) ) {
- urldb_load(nsoption_charp(url_file));
+ urldb_load(nsoption_charp(url_file));
}
LOG(("Loading cookies from: %s", nsoption_charp(cookie_file) ));
if( strlen(nsoption_charp(cookie_file)) ) {
- urldb_load_cookies(nsoption_charp(cookie_file));
+ urldb_load_cookies(nsoption_charp(cookie_file));
}
if (process_cmdline(argc,argv) != true)
- die("unable to process command line.\n");
+ die("unable to process command line.\n");
LOG(("Initializing NKC..."));
nkc_init();
-
LOG(("Initializing plotters..."));
plot_init(nsoption_charp(atari_font_driver));
@@ -977,22 +1034,18 @@ static void gui_init(int argc, char** argv)
aes_event_in.emi_m1.g_w = 1;
aes_event_in.emi_m1.g_h = 1;
//next_poll = clock() + (CLOCKS_PER_SEC>>3);
-}
-static char *theapp = (char*)"NetSurf";
-static void gui_init2(int argc, char** argv)
-{
deskmenu_init();
menu_register( -1, theapp);
if (sys_type() & (SYS_MAGIC|SYS_NAES|SYS_XAAES)) {
- menu_register( _AESapid, (char*)" NetSurf ");
+ menu_register( _AESapid, (char*)" NetSurf ");
}
gemtk_wm_init();
/* Initialize the netsurf treeview framework with default font size: */
treeview_init(0);
- /* Initialize the specific treeview windows: */
+ /* Initialize the specific treeview windows: */
atari_global_history_init();
atari_hotlist_init();
atari_cookie_manager_init();
@@ -1036,7 +1089,6 @@ static struct gui_fetch_table atari_fetch_table = {
};
static struct gui_browser_table atari_browser_table = {
- .poll = gui_poll,
.schedule = atari_schedule,
.quit = gui_quit,
@@ -1045,7 +1097,8 @@ static struct gui_browser_table atari_browser_table = {
};
/* #define WITH_DBG_LOGFILE 1 */
-/** Entry point from OS.
+/**
+ * Entry point from OS.
*
* /param argc The number of arguments in the string vector.
* /param argv The argument string vector.
@@ -1062,7 +1115,7 @@ int main(int argc, char** argv)
nserror ret;
struct netsurf_table atari_table = {
- .browser = &atari_browser_table,
+ .browser = &atari_browser_table,
.window = &atari_window_table,
.clipboard = &atari_clipboard_table,
.download = atari_download_table,
@@ -1070,12 +1123,12 @@ int main(int argc, char** argv)
.file = atari_file_table,
.utf8 = atari_utf8_table,
.search = atari_search_table,
- .llcache = filesystem_llcache_table
+ .llcache = filesystem_llcache_table
};
ret = netsurf_register(&atari_table);
if (ret != NSERROR_OK) {
- die("NetSurf operation table failed registration");
+ die("NetSurf operation table failed registration");
}
/** @todo logging file descriptor update belongs in a nslog_init callback */
@@ -1104,7 +1157,7 @@ int main(int argc, char** argv)
/* user options setup */
ret = nsoption_init(set_defaults, &nsoptions, &nsoptions_default);
if (ret != NSERROR_OK) {
- die("Options failed to initialise");
+ die("Options failed to initialise");
}
nsoption_read(options, NULL);
nsoption_commandline(&argc, argv, NULL);
@@ -1119,18 +1172,15 @@ int main(int argc, char** argv)
LOG(("Initializing GUI..."));
gui_init(argc, argv);
- LOG(("Initializing GUI2"));
- gui_init2(argc, argv);
-
graf_mouse( ARROW , NULL);
LOG(("Creating initial browser window..."));
addr = option_homepage_url;
if (strncmp(addr, "file://", 7) && strncmp(addr, "http://", 7)) {
- if (stat(addr, &stat_buf) == 0) {
- file_url = local_file_to_url(addr);
- addr = file_url;
- }
+ if (stat(addr, &stat_buf) == 0) {
+ file_url = local_file_to_url(addr);
+ addr = file_url;
+ }
}
/* create an initial browser window */
@@ -1146,8 +1196,10 @@ int main(int argc, char** argv)
if (ret != NSERROR_OK) {
warn_user(messages_get_errorcode(ret), 0);
} else {
- LOG(("Entering NetSurf mainloop..."));
- netsurf_main_loop();
+ LOG(("Entering Atari event mainloop..."));
+ while (!atari_quit) {
+ atari_poll();
+ }
}
netsurf_exit();
@@ -1158,9 +1210,8 @@ int main(int argc, char** argv)
fclose(stdout);
fclose(stderr);
#endif
- LOG(("exit_gem"));
+ LOG(("exit_gem"));
exit_gem();
return 0;
}
-
diff --git a/desktop/gui.h b/desktop/gui.h
index 21dd85e..4dc638c 100644
--- a/desktop/gui.h
+++ b/desktop/gui.h
@@ -106,8 +106,10 @@ struct gui_window_table {
/**
* Destroy previously created gui window
+ *
+ * \param gw The gui window to destroy.
*/
- void (*destroy)(struct gui_window *g);
+ void (*destroy)(struct gui_window *gw);
/**
* Force a redraw of the entire contents of a window.
@@ -193,12 +195,20 @@ struct gui_window_table {
void (*set_title)(struct gui_window *g, const char *title);
/**
- * set the navigation url.
+ * Set the navigation url.
+ *
+ * \param gw window to update.
+ * \param url The url to use as icon.
*/
- void (*set_url)(struct gui_window *g, const char *url);
+ void (*set_url)(struct gui_window *gw, const char *url);
- /** set favicon */
- void (*set_icon)(struct gui_window *g, struct hlcache_handle *icon);
+ /**
+ * Set a favicon for a gui window.
+ *
+ * \param gw window to update.
+ * \param icon handle to object to use as icon.
+ */
+ void (*set_icon)(struct gui_window *gw, struct hlcache_handle *icon);
/**
* Set the status bar of a browser window.
diff --git a/windows/gui.c b/windows/gui.c
index 19a31c1..b7ca313 100644
--- a/windows/gui.c
+++ b/windows/gui.c
@@ -61,6 +61,8 @@
#include "windows/windbg.h"
#include "windows/filetype.h"
+static bool win32_quit = false;
+
HINSTANCE hInstance; /** win32 application instance handle. */
struct gui_window *input_window = NULL;
@@ -95,37 +97,42 @@ static void nsws_set_scale(struct gui_window *gw, float scale)
browser_window_set_scale(gw->bw, scale, true);
}
-
-static void win32_poll(bool active)
+/* exported interface documented in gui.h */
+void win32_run(void)
{
MSG Msg; /* message from system */
BOOL bRet; /* message fetch result */
int timeout; /* timeout in miliseconds */
UINT timer_id = 0;
- /* run the scheduler and discover how long to wait for the next event */
- timeout = schedule_run();
+ while (!win32_quit) {
+ /* run the scheduler and discover how long to wait for
+ * the next event.
+ */
+ timeout = schedule_run();
- if (timeout == 0) {
- bRet = PeekMessage(&Msg, NULL, 0, 0, PM_REMOVE);
- } else {
- if (timeout > 0) {
- /* set up a timer to ensure we get woken */
- timer_id = SetTimer(NULL, 0, timeout, NULL);
- }
+ if (timeout == 0) {
+ bRet = PeekMessage(&Msg, NULL, 0, 0, PM_REMOVE);
+ } else {
+ if (timeout > 0) {
+ /* set up a timer to ensure we get woken */
+ timer_id = SetTimer(NULL, 0, timeout, NULL);
+ }
- /* wait for a message */
- bRet = GetMessage(&Msg, NULL, 0, 0);
+ /* wait for a message */
+ bRet = GetMessage(&Msg, NULL, 0, 0);
- /* if a timer was sucessfully created remove it */
- if (timer_id != 0) {
- KillTimer(NULL, timer_id);
+ /* if a timer was sucessfully created remove it */
+ if (timer_id != 0) {
+ KillTimer(NULL, timer_id);
+ timer_id = 0;
+ }
}
- }
- if (bRet > 0) {
- TranslateMessage(&Msg);
- DispatchMessage(&Msg);
+ if (bRet > 0) {
+ TranslateMessage(&Msg);
+ DispatchMessage(&Msg);
+ }
}
}
@@ -1124,7 +1131,7 @@ nsws_window_event_callback(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
RemoveProp(hwnd, TEXT("GuiWnd"));
browser_window_destroy(gw->bw);
if (--open_windows <= 0) {
- netsurf_quit = true;
+ win32_quit = true;
}
break;
@@ -2126,7 +2133,6 @@ struct gui_fetch_table *win32_fetch_table = &fetch_table;
static struct gui_browser_table browser_table = {
- .poll = win32_poll,
.schedule = win32_schedule,
};
diff --git a/windows/gui.h b/windows/gui.h
index 82ae836..007afe7 100644
--- a/windows/gui.h
+++ b/windows/gui.h
@@ -97,5 +97,9 @@ nserror nsws_create_main_class(HINSTANCE hinstance);
*/
bool nsws_window_go(HWND hwnd, const char *url);
+/**
+ * Run the win32 message loop with scheduling
+ */
+void win32_run(void);
#endif
diff --git a/windows/main.c b/windows/main.c
index 20f9f04..40b083f 100644
--- a/windows/main.c
+++ b/windows/main.c
@@ -54,7 +54,7 @@ static nsurl *gui_get_resource_url(const char *path)
return url;
}
-/**
+/**
* Ensures output logging stream is available
*/
static bool nslog_ensure(FILE *fptr)
@@ -70,7 +70,7 @@ static bool nslog_ensure(FILE *fptr)
}
/**
- * Set option defaults for framebuffer frontend
+ * Set option defaults for windows frontend
*
* @param defaults The option table to update.
* @return error status.
@@ -202,7 +202,7 @@ WinMain(HINSTANCE hInstance, HINSTANCE hLastInstance, LPSTR lpcli, int ncmd)
if (ret != NSERROR_OK) {
warn_user(messages_get_errorcode(ret), 0);
} else {
- netsurf_main_loop();
+ win32_run();
}
netsurf_exit();
--
NetSurf Browser
8 years, 3 months
libsvgtiny: branch master updated. release/0.1.2-2-ga285e39
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/libsvgtiny.git/shortlog/a285e3942eb288b92a...
...commit http://git.netsurf-browser.org/libsvgtiny.git/commit/a285e3942eb288b92a3b...
...tree http://git.netsurf-browser.org/libsvgtiny.git/tree/a285e3942eb288b92a3ba7...
The branch, master has been updated
via a285e3942eb288b92a3ba77eaf564d55340b2f9d (commit)
via f21ee86fd200931897c03149ca8df5570ef24120 (commit)
from 4e4c0d2c2abb1e576aa91791ae660bc8f2b9c77a (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/libsvgtiny.git/commit/?id=a285e3942eb288b9...
commit a285e3942eb288b92a3ba77eaf564d55340b2f9d
Author: Paul Mecklenburg <paul.mecklenburg(a)gmail.com>
Commit: Michael Drake <tlsa(a)netsurf-browser.org>
Fix relative move commands following a path close.
Both 'M' and 'm' are moves and therefore start a new (sub)path. In
either case the location should be cached so that a later 'close path'
(z or Z) knows the location it is returning to. The location is not
written to 'p', since it is assumed that the client code remembers. If
the next move is relative (lowercase), then it's important that last_x,
last_y were correctly updated while processing Z/z.
diff --git a/src/svgtiny.c b/src/svgtiny.c
index 5be977f..413697c 100644
--- a/src/svgtiny.c
+++ b/src/svgtiny.c
@@ -407,6 +407,7 @@ svgtiny_code svgtiny_parse_path(dom_element *path,
float last_x = 0, last_y = 0;
float last_cubic_x = 0, last_cubic_y = 0;
float last_quad_x = 0, last_quad_y = 0;
+ float subpath_first_x = 0, subpath_first_y = 0;
svgtiny_setup_state_local(&state);
@@ -468,6 +469,10 @@ svgtiny_code svgtiny_parse_path(dom_element *path,
x += last_x;
y += last_y;
}
+ if (plot_command == svgtiny_PATH_MOVE) {
+ subpath_first_x = x;
+ subpath_first_y = y;
+ }
p[i++] = last_cubic_x = last_quad_x = last_x
= x;
p[i++] = last_cubic_y = last_quad_y = last_y
@@ -481,6 +486,8 @@ svgtiny_code svgtiny_parse_path(dom_element *path,
/*LOG(("closepath"));*/
p[i++] = svgtiny_PATH_CLOSE;
s += n;
+ last_cubic_x = last_quad_x = last_x = subpath_first_x;
+ last_cubic_y = last_quad_y = last_y = subpath_first_y;
/* horizontal lineto (H, h) (1 argument) */
} else if (sscanf(s, " %1[Hh] %f %n", command, &x, &n) == 2) {
commitdiff http://git.netsurf-browser.org/libsvgtiny.git/commit/?id=f21ee86fd2009318...
commit f21ee86fd200931897c03149ca8df5570ef24120
Author: Michael Drake <tlsa(a)netsurf-browser.org>
Commit: Michael Drake <tlsa(a)netsurf-browser.org>
Add test case image for broken behaviour of relative move.
diff --git a/test/data/move.svg b/test/data/move.svg
new file mode 100644
index 0000000..ef549b7
--- /dev/null
+++ b/test/data/move.svg
@@ -0,0 +1,8 @@
+<svg xmlns="http://www.w3.org/2000/svg"
+ version="1.1" height="500" width="600">
+ <path d="M200 100 L300 100 L300 200 Z
+ M300 100 L400 100 L400 200 Z" />
+ <path d="M200 300 L300 300 L300 400 Z
+ m300 100 L400 300 L400 400 Z" />
+</svg>
+
-----------------------------------------------------------------------
Summary of changes:
src/svgtiny.c | 7 +++++++
test/data/move.svg | 8 ++++++++
2 files changed, 15 insertions(+), 0 deletions(-)
create mode 100644 test/data/move.svg
diff --git a/src/svgtiny.c b/src/svgtiny.c
index 5be977f..413697c 100644
--- a/src/svgtiny.c
+++ b/src/svgtiny.c
@@ -407,6 +407,7 @@ svgtiny_code svgtiny_parse_path(dom_element *path,
float last_x = 0, last_y = 0;
float last_cubic_x = 0, last_cubic_y = 0;
float last_quad_x = 0, last_quad_y = 0;
+ float subpath_first_x = 0, subpath_first_y = 0;
svgtiny_setup_state_local(&state);
@@ -468,6 +469,10 @@ svgtiny_code svgtiny_parse_path(dom_element *path,
x += last_x;
y += last_y;
}
+ if (plot_command == svgtiny_PATH_MOVE) {
+ subpath_first_x = x;
+ subpath_first_y = y;
+ }
p[i++] = last_cubic_x = last_quad_x = last_x
= x;
p[i++] = last_cubic_y = last_quad_y = last_y
@@ -481,6 +486,8 @@ svgtiny_code svgtiny_parse_path(dom_element *path,
/*LOG(("closepath"));*/
p[i++] = svgtiny_PATH_CLOSE;
s += n;
+ last_cubic_x = last_quad_x = last_x = subpath_first_x;
+ last_cubic_y = last_quad_y = last_y = subpath_first_y;
/* horizontal lineto (H, h) (1 argument) */
} else if (sscanf(s, " %1[Hh] %f %n", command, &x, &n) == 2) {
diff --git a/test/data/move.svg b/test/data/move.svg
new file mode 100644
index 0000000..ef549b7
--- /dev/null
+++ b/test/data/move.svg
@@ -0,0 +1,8 @@
+<svg xmlns="http://www.w3.org/2000/svg"
+ version="1.1" height="500" width="600">
+ <path d="M200 100 L300 100 L300 200 Z
+ M300 100 L400 100 L400 200 Z" />
+ <path d="M200 300 L300 300 L300 400 Z
+ m300 100 L400 300 L400 400 Z" />
+</svg>
+
--
NetSurf SVG decoder
8 years, 3 months
netsurf: branch master updated. release/3.2-82-g1a2040b
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/1a2040bc726b151a1d1b1...
...commit http://git.netsurf-browser.org/netsurf.git/commit/1a2040bc726b151a1d1b145...
...tree http://git.netsurf-browser.org/netsurf.git/tree/1a2040bc726b151a1d1b1459a...
The branch, master has been updated
via 1a2040bc726b151a1d1b1459ae0fbccef66d7d82 (commit)
from ad22d5446cfc62cb69023de2dcdd86b3b680fc98 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=1a2040bc726b151a1d1...
commit 1a2040bc726b151a1d1b1459ae0fbccef66d7d82
Author: Vincent Sanders <vince(a)kyllikki.org>
Commit: Vincent Sanders <vince(a)kyllikki.org>
Trivial sepelling, documentation and whitespace cleanups
diff --git a/content/fetchers/about.c b/content/fetchers/about.c
index 8c4d29a..d9c3712 100644
--- a/content/fetchers/about.c
+++ b/content/fetchers/about.c
@@ -16,9 +16,11 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-/* about: URL handling.
+/** \file content/fetchers/about.c
*
- * Based on the data fetcher by Rob Kendrick
+ * URL handling for the "about" scheme.
+ *
+ * Based on the data fetcher by Rob Kendrick
* This fetcher provides a simple scheme for the user to access
* information from the browser from a known, fixed URL.
*/
@@ -174,10 +176,13 @@ static bool fetch_about_licence_handler(struct fetch_about_context *ctx)
return true;
}
-/** Handler to generate about:cache page.
+/**
+ * Handler to generate about:cache page.
*
- * Shows details of current iamge cache
+ * Shows details of current image cache.
*
+ * \param ctx The fetcher context.
+ * \return true if handled false if aborted.
*/
static bool fetch_about_imagecache_handler(struct fetch_about_context *ctx)
{
@@ -199,7 +204,7 @@ static bool fetch_about_imagecache_handler(struct fetch_about_context *ctx)
msg.data.header_or_data.buf = (const uint8_t *) buffer;
/* page head */
- slen = snprintf(buffer, sizeof buffer,
+ slen = snprintf(buffer, sizeof buffer,
"<html>\n<head>\n"
"<title>NetSurf Browser Image Cache Status</title>\n"
"<link rel=\"stylesheet\" type=\"text/css\" "
@@ -216,7 +221,7 @@ static bool fetch_about_imagecache_handler(struct fetch_about_context *ctx)
goto fetch_about_imagecache_handler_aborted;
/* image cache summary */
- slen = image_cache_snsummaryf(buffer, sizeof(buffer),
+ slen = image_cache_snsummaryf(buffer, sizeof(buffer),
"<p>Configured limit of %a hysteresis of %b</p>\n"
"<p>Total bitmap size in use %c (in %d)</p>\n"
"<p>Age %es</p>\n"
@@ -225,7 +230,7 @@ static bool fetch_about_imagecache_handler(struct fetch_about_context *ctx)
"<p>Cache total/hit/miss/fail (counts) %j/%k/%l/%m "
"(%pj%%/%pk%%/%pl%%/%pm%%)</p>\n"
"<p>Cache total/hit/miss/fail (size) %n/%o/%q/%r "
- "(%pn%%/%po%%/%pq%%/%pr%%)</p>\n"
+ "(%pn%%/%po%%/%pq%%/%pr%%)</p>\n"
"<p>Total images never rendered: %s "
"(includes %t that were converted)</p>\n"
"<p>Total number of excessive conversions: %u "
@@ -233,7 +238,7 @@ static bool fetch_about_imagecache_handler(struct fetch_about_context *ctx)
"</p>\n"
"<p>Bitmap of size %w had most (%x) conversions</p>\n"
"<h2>Current image cache contents</h2>\n");
- if (slen >= (int) (sizeof(buffer)))
+ if (slen >= (int) (sizeof(buffer)))
goto fetch_about_imagecache_handler_aborted; /* overflow */
msg.data.header_or_data.len = slen;
@@ -242,7 +247,7 @@ static bool fetch_about_imagecache_handler(struct fetch_about_context *ctx)
/* image cache entry table */
- slen = snprintf(buffer, sizeof buffer,
+ slen = snprintf(buffer, sizeof buffer,
"<p class=\"imagecachelist\">\n"
"<strong>"
"<span>Entry</span>"
@@ -267,7 +272,7 @@ static bool fetch_about_imagecache_handler(struct fetch_about_context *ctx)
"<span>%s</span>"
"<span>%o</span>"
"</a>\n");
- if (res <= 0)
+ if (res <= 0)
break; /* last option */
if (res >= (int) (sizeof buffer - slen)) {
@@ -283,7 +288,7 @@ static bool fetch_about_imagecache_handler(struct fetch_about_context *ctx)
}
} while (res > 0);
- slen += snprintf(buffer + slen, sizeof buffer - slen,
+ slen += snprintf(buffer + slen, sizeof buffer - slen,
"</p>\n</body>\n</html>\n");
msg.data.header_or_data.len = slen;
@@ -319,7 +324,7 @@ static bool fetch_about_config_handler(struct fetch_about_context *ctx)
msg.type = FETCH_DATA;
msg.data.header_or_data.buf = (const uint8_t *) buffer;
- slen = snprintf(buffer, sizeof buffer,
+ slen = snprintf(buffer, sizeof buffer,
"<html>\n<head>\n"
"<title>NetSurf Browser Config</title>\n"
"<link rel=\"stylesheet\" type=\"text/css\" "
@@ -335,11 +340,11 @@ static bool fetch_about_config_handler(struct fetch_about_context *ctx)
"<tr><th>Option</th><th>Type</th><th>Provenance</th><th>Setting</th></tr>\n");
do {
- res = nsoption_snoptionf(buffer + slen,
+ res = nsoption_snoptionf(buffer + slen,
sizeof buffer - slen,
opt_loop,
"<tr><th>%k</th><td>%t</td><td>%p</td><td>%V</td></tr>\n");
- if (res <= 0)
+ if (res <= 0)
break; /* last option */
if (res >= (int) (sizeof buffer - slen)) {
@@ -355,7 +360,7 @@ static bool fetch_about_config_handler(struct fetch_about_context *ctx)
}
} while (res > 0);
- slen += snprintf(buffer + slen, sizeof buffer - slen,
+ slen += snprintf(buffer + slen, sizeof buffer - slen,
"</table>\n</body>\n</html>\n");
msg.data.header_or_data.len = slen;
@@ -373,7 +378,7 @@ fetch_about_config_handler_aborted:
/** Generate the text of a Choices file which represents the current
- * in use options.
+ * in use options.
*/
static bool fetch_about_choices_handler(struct fetch_about_context *ctx)
{
@@ -394,15 +399,15 @@ static bool fetch_about_choices_handler(struct fetch_about_context *ctx)
msg.type = FETCH_DATA;
msg.data.header_or_data.buf = (const uint8_t *) buffer;
- slen = snprintf(buffer, sizeof buffer,
+ slen = snprintf(buffer, sizeof buffer,
"# Automatically generated current NetSurf browser Choices\n");
do {
- res = nsoption_snoptionf(buffer + slen,
- sizeof buffer - slen,
- opt_loop,
+ res = nsoption_snoptionf(buffer + slen,
+ sizeof buffer - slen,
+ opt_loop,
"%k:%v\n");
- if (res <= 0)
+ if (res <= 0)
break; /* last option */
if (res >= (int) (sizeof buffer - slen)) {
@@ -443,7 +448,7 @@ static bool fetch_about_testament_handler(struct fetch_about_context *ctx)
int code = 200;
int slen;
int i;
-
+
/* content is going to return ok */
fetch_set_http_code(ctx->fetchh, code);
@@ -455,27 +460,27 @@ static bool fetch_about_testament_handler(struct fetch_about_context *ctx)
msg.type = FETCH_DATA;
msg.data.header_or_data.buf = (const uint8_t *) buffer;
- slen = snprintf(buffer, sizeof buffer,
+ slen = snprintf(buffer, sizeof buffer,
"# Automatically generated by NetSurf build system\n\n");
msg.data.header_or_data.len = slen;
if (fetch_about_send_callback(&msg, ctx))
goto fetch_about_testament_handler_aborted;
-
- slen = snprintf(buffer, sizeof buffer,
+
+ slen = snprintf(buffer, sizeof buffer,
#if defined(WT_BRANCHISTRUNK) || defined(WT_BRANCHISMASTER)
"# This is a *DEVELOPMENT* build from the main line.\n\n"
#elif defined(WT_BRANCHISTAG) && (WT_MODIFIED == 0)
"# This is a tagged build of NetSurf\n"
#ifdef WT_TAGIS
- "# The tag used was '" WT_TAGIS "'\n\n"
+ "# The tag used was '" WT_TAGIS "'\n\n"
#else
- "\n"
+ "\n"
#endif
#elif defined(WT_NO_SVN) || defined(WT_NO_GIT)
"# This NetSurf was built outside of our revision "
"control environment.\n"
- "# This testament is therefore very useful.\n\n"
+ "# This testament is therefore not very useful.\n\n"
#else
"# This NetSurf was built from a branch (" WT_BRANCHPATH ").\n\n"
#endif
@@ -484,29 +489,29 @@ static bool fetch_about_testament_handler(struct fetch_about_context *ctx)
#endif
);
- msg.data.header_or_data.len = slen;
+ msg.data.header_or_data.len = slen;
if (fetch_about_send_callback(&msg, ctx))
goto fetch_about_testament_handler_aborted;
-
- slen = snprintf(buffer, sizeof buffer,
+
+ slen = snprintf(buffer, sizeof buffer,
"Built by %s (%s) from %s at revision %s on %s\n\n",
GECOS, USERNAME, WT_BRANCHPATH, WT_REVID, WT_COMPILEDATE);
msg.data.header_or_data.len = slen;
if (fetch_about_send_callback(&msg, ctx))
goto fetch_about_testament_handler_aborted;
-
- slen = snprintf(buffer, sizeof buffer,
+
+ slen = snprintf(buffer, sizeof buffer,
"Built on %s in %s\n\n",
WT_HOSTNAME, WT_ROOT);
msg.data.header_or_data.len = slen;
if (fetch_about_send_callback(&msg, ctx))
goto fetch_about_testament_handler_aborted;
-
+
if (WT_MODIFIED > 0) {
- slen = snprintf(buffer, sizeof buffer,
+ slen = snprintf(buffer, sizeof buffer,
"Working tree has %d modification%s\n\n",
WT_MODIFIED, WT_MODIFIED == 1 ? "" : "s");
} else {
@@ -517,7 +522,7 @@ static bool fetch_about_testament_handler(struct fetch_about_context *ctx)
msg.data.header_or_data.len = slen;
if (fetch_about_send_callback(&msg, ctx))
goto fetch_about_testament_handler_aborted;
-
+
for (i = 0; i < WT_MODIFIED; ++i) {
slen = snprintf(buffer, sizeof buffer,
" %s %s\n",
@@ -526,10 +531,10 @@ static bool fetch_about_testament_handler(struct fetch_about_context *ctx)
msg.data.header_or_data.len = slen;
if (fetch_about_send_callback(&msg, ctx))
goto fetch_about_testament_handler_aborted;
-
+
}
- msg.type = FETCH_FINISHED;
+ msg.type = FETCH_FINISHED;
fetch_about_send_callback(&msg, ctx);
return true;
@@ -604,15 +609,15 @@ struct about_handlers about_handler_list[] = {
fetch_about_imagecache_handler, true },
/* The default blank page */
{ "blank", SLEN("blank"), NULL,
- fetch_about_blank_handler, true }
+ fetch_about_blank_handler, true }
};
#define about_handler_list_len (sizeof(about_handler_list) / \
sizeof(struct about_handlers))
/**
- * List all the valid about: paths available
- *
+ * List all the valid about: paths available
+ *
* \param ctx The fetch context.
* \return true for sucess or false to generate an error.
*/
@@ -635,7 +640,7 @@ static bool fetch_about_about_handler(struct fetch_about_context *ctx)
msg.type = FETCH_DATA;
msg.data.header_or_data.buf = (const uint8_t *) buffer;
- slen = snprintf(buffer, sizeof buffer,
+ slen = snprintf(buffer, sizeof buffer,
"<html>\n<head>\n"
"<title>NetSurf List of About pages</title>\n"
"<link rel=\"stylesheet\" type=\"text/css\" "
@@ -655,11 +660,11 @@ static bool fetch_about_about_handler(struct fetch_about_context *ctx)
if (about_handler_list[abt_loop].hidden)
continue;
- res = snprintf(buffer + slen, sizeof buffer - slen,
- "<li><a href=\"about:%s\">about:%s</a></li>\n",
- about_handler_list[abt_loop].name,
+ res = snprintf(buffer + slen, sizeof buffer - slen,
+ "<li><a href=\"about:%s\">about:%s</a></li>\n",
+ about_handler_list[abt_loop].name,
about_handler_list[abt_loop].name);
- if (res <= 0)
+ if (res <= 0)
break; /* last option */
if (res >= (int)(sizeof buffer - slen)) {
@@ -674,7 +679,7 @@ static bool fetch_about_about_handler(struct fetch_about_context *ctx)
}
}
- slen += snprintf(buffer + slen, sizeof buffer - slen,
+ slen += snprintf(buffer + slen, sizeof buffer - slen,
"</ul>\n</body>\n</html>\n");
msg.data.header_or_data.len = slen;
@@ -698,8 +703,8 @@ static bool fetch_about_initialise(lwc_string *scheme)
lwc_error error;
for (abt_loop = 0; abt_loop < about_handler_list_len; abt_loop++) {
- error = lwc_intern_string(about_handler_list[abt_loop].name,
- about_handler_list[abt_loop].name_len,
+ error = lwc_intern_string(about_handler_list[abt_loop].name,
+ about_handler_list[abt_loop].name_len,
&about_handler_list[abt_loop].lname);
if (error != lwc_error_ok) {
while (abt_loop-- != 0) {
@@ -747,15 +752,15 @@ fetch_about_setup(struct fetch *fetchh,
path = nsurl_get_component(url, NSURL_PATH);
- for (handler_loop = 0;
- handler_loop < about_handler_list_len;
+ for (handler_loop = 0;
+ handler_loop < about_handler_list_len;
handler_loop++) {
ctx->handler = about_handler_list[handler_loop].handler;
- if (lwc_string_isequal(path,
- about_handler_list[handler_loop].lname,
+ if (lwc_string_isequal(path,
+ about_handler_list[handler_loop].lname,
&match) == lwc_error_ok && match) {
break;
- }
+ }
}
if (path != NULL)
diff --git a/desktop/print.c b/desktop/print.c
index 8f83f2d..9b3b297 100644
--- a/desktop/print.c
+++ b/desktop/print.c
@@ -17,8 +17,8 @@
*/
/** \file
- * Output-in-pages implementation
-*/
+ * Implementation of paginated output.
+ */
#include "utils/config.h"
@@ -194,7 +194,7 @@ bool print_apply_settings(hlcache_handle *content,
if (settings == NULL)
return false;
- /*Apply settings - adjust page size etc*/
+ /* Apply settings - adjust page size etc */
page_content_width = (settings->page_width -
FIXTOFLT(FSUB(settings->margins[MARGINLEFT],
@@ -243,8 +243,8 @@ bool print_cleanup(hlcache_handle *content, const struct printer *printer,
* \param configuration the requested configuration
* \param filename the filename or NULL
* \param font handling functions
- * \return print_settings in case if successful, NULL if unknown configuration \
- * or lack of memory.
+ * \return print_settings in case if successful, NULL if unknown
+ * configuration or lack of memory.
*/
struct print_settings *print_make_settings(print_configuration configuration,
const char *filename, const struct font_functions *font_func)
diff --git a/desktop/printer.h b/desktop/printer.h
index 3589223..7fda8bd 100644
--- a/desktop/printer.h
+++ b/desktop/printer.h
@@ -17,9 +17,11 @@
*/
/** \file
- * Printer interface - contains plotter to use, functions for
- * initialization, handling pages and cleaning up.
-*/
+ * Printer interface.
+ *
+ * Interface to generic plotters, initialization, handling pages and
+ * cleaning up.
+ */
#ifndef NETSURF_DESKTOP_PRINTER_H
#define NETSURF_DESKTOP_PRINTER_H
diff --git a/utils/nsoption.c b/utils/nsoption.c
index f6244cd..669b26c 100644
--- a/utils/nsoption.c
+++ b/utils/nsoption.c
@@ -602,7 +602,7 @@ nsoption_read(const char *path, struct nsoption_s *opts)
return NSERROR_NOT_FOUND;
}
- LOG(("Sucessfully opened '%s' for Options file", path));
+ LOG(("Successfully opened '%s' for Options file", path));
while (fgets(s, 100, fp)) {
char *colon, *value;
-----------------------------------------------------------------------
Summary of changes:
content/fetchers/about.c | 113 ++++++++++++++++++++++++----------------------
desktop/print.c | 10 ++--
desktop/printer.h | 8 ++-
utils/nsoption.c | 2 +-
4 files changed, 70 insertions(+), 63 deletions(-)
diff --git a/content/fetchers/about.c b/content/fetchers/about.c
index 8c4d29a..d9c3712 100644
--- a/content/fetchers/about.c
+++ b/content/fetchers/about.c
@@ -16,9 +16,11 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-/* about: URL handling.
+/** \file content/fetchers/about.c
*
- * Based on the data fetcher by Rob Kendrick
+ * URL handling for the "about" scheme.
+ *
+ * Based on the data fetcher by Rob Kendrick
* This fetcher provides a simple scheme for the user to access
* information from the browser from a known, fixed URL.
*/
@@ -174,10 +176,13 @@ static bool fetch_about_licence_handler(struct fetch_about_context *ctx)
return true;
}
-/** Handler to generate about:cache page.
+/**
+ * Handler to generate about:cache page.
*
- * Shows details of current iamge cache
+ * Shows details of current image cache.
*
+ * \param ctx The fetcher context.
+ * \return true if handled false if aborted.
*/
static bool fetch_about_imagecache_handler(struct fetch_about_context *ctx)
{
@@ -199,7 +204,7 @@ static bool fetch_about_imagecache_handler(struct fetch_about_context *ctx)
msg.data.header_or_data.buf = (const uint8_t *) buffer;
/* page head */
- slen = snprintf(buffer, sizeof buffer,
+ slen = snprintf(buffer, sizeof buffer,
"<html>\n<head>\n"
"<title>NetSurf Browser Image Cache Status</title>\n"
"<link rel=\"stylesheet\" type=\"text/css\" "
@@ -216,7 +221,7 @@ static bool fetch_about_imagecache_handler(struct fetch_about_context *ctx)
goto fetch_about_imagecache_handler_aborted;
/* image cache summary */
- slen = image_cache_snsummaryf(buffer, sizeof(buffer),
+ slen = image_cache_snsummaryf(buffer, sizeof(buffer),
"<p>Configured limit of %a hysteresis of %b</p>\n"
"<p>Total bitmap size in use %c (in %d)</p>\n"
"<p>Age %es</p>\n"
@@ -225,7 +230,7 @@ static bool fetch_about_imagecache_handler(struct fetch_about_context *ctx)
"<p>Cache total/hit/miss/fail (counts) %j/%k/%l/%m "
"(%pj%%/%pk%%/%pl%%/%pm%%)</p>\n"
"<p>Cache total/hit/miss/fail (size) %n/%o/%q/%r "
- "(%pn%%/%po%%/%pq%%/%pr%%)</p>\n"
+ "(%pn%%/%po%%/%pq%%/%pr%%)</p>\n"
"<p>Total images never rendered: %s "
"(includes %t that were converted)</p>\n"
"<p>Total number of excessive conversions: %u "
@@ -233,7 +238,7 @@ static bool fetch_about_imagecache_handler(struct fetch_about_context *ctx)
"</p>\n"
"<p>Bitmap of size %w had most (%x) conversions</p>\n"
"<h2>Current image cache contents</h2>\n");
- if (slen >= (int) (sizeof(buffer)))
+ if (slen >= (int) (sizeof(buffer)))
goto fetch_about_imagecache_handler_aborted; /* overflow */
msg.data.header_or_data.len = slen;
@@ -242,7 +247,7 @@ static bool fetch_about_imagecache_handler(struct fetch_about_context *ctx)
/* image cache entry table */
- slen = snprintf(buffer, sizeof buffer,
+ slen = snprintf(buffer, sizeof buffer,
"<p class=\"imagecachelist\">\n"
"<strong>"
"<span>Entry</span>"
@@ -267,7 +272,7 @@ static bool fetch_about_imagecache_handler(struct fetch_about_context *ctx)
"<span>%s</span>"
"<span>%o</span>"
"</a>\n");
- if (res <= 0)
+ if (res <= 0)
break; /* last option */
if (res >= (int) (sizeof buffer - slen)) {
@@ -283,7 +288,7 @@ static bool fetch_about_imagecache_handler(struct fetch_about_context *ctx)
}
} while (res > 0);
- slen += snprintf(buffer + slen, sizeof buffer - slen,
+ slen += snprintf(buffer + slen, sizeof buffer - slen,
"</p>\n</body>\n</html>\n");
msg.data.header_or_data.len = slen;
@@ -319,7 +324,7 @@ static bool fetch_about_config_handler(struct fetch_about_context *ctx)
msg.type = FETCH_DATA;
msg.data.header_or_data.buf = (const uint8_t *) buffer;
- slen = snprintf(buffer, sizeof buffer,
+ slen = snprintf(buffer, sizeof buffer,
"<html>\n<head>\n"
"<title>NetSurf Browser Config</title>\n"
"<link rel=\"stylesheet\" type=\"text/css\" "
@@ -335,11 +340,11 @@ static bool fetch_about_config_handler(struct fetch_about_context *ctx)
"<tr><th>Option</th><th>Type</th><th>Provenance</th><th>Setting</th></tr>\n");
do {
- res = nsoption_snoptionf(buffer + slen,
+ res = nsoption_snoptionf(buffer + slen,
sizeof buffer - slen,
opt_loop,
"<tr><th>%k</th><td>%t</td><td>%p</td><td>%V</td></tr>\n");
- if (res <= 0)
+ if (res <= 0)
break; /* last option */
if (res >= (int) (sizeof buffer - slen)) {
@@ -355,7 +360,7 @@ static bool fetch_about_config_handler(struct fetch_about_context *ctx)
}
} while (res > 0);
- slen += snprintf(buffer + slen, sizeof buffer - slen,
+ slen += snprintf(buffer + slen, sizeof buffer - slen,
"</table>\n</body>\n</html>\n");
msg.data.header_or_data.len = slen;
@@ -373,7 +378,7 @@ fetch_about_config_handler_aborted:
/** Generate the text of a Choices file which represents the current
- * in use options.
+ * in use options.
*/
static bool fetch_about_choices_handler(struct fetch_about_context *ctx)
{
@@ -394,15 +399,15 @@ static bool fetch_about_choices_handler(struct fetch_about_context *ctx)
msg.type = FETCH_DATA;
msg.data.header_or_data.buf = (const uint8_t *) buffer;
- slen = snprintf(buffer, sizeof buffer,
+ slen = snprintf(buffer, sizeof buffer,
"# Automatically generated current NetSurf browser Choices\n");
do {
- res = nsoption_snoptionf(buffer + slen,
- sizeof buffer - slen,
- opt_loop,
+ res = nsoption_snoptionf(buffer + slen,
+ sizeof buffer - slen,
+ opt_loop,
"%k:%v\n");
- if (res <= 0)
+ if (res <= 0)
break; /* last option */
if (res >= (int) (sizeof buffer - slen)) {
@@ -443,7 +448,7 @@ static bool fetch_about_testament_handler(struct fetch_about_context *ctx)
int code = 200;
int slen;
int i;
-
+
/* content is going to return ok */
fetch_set_http_code(ctx->fetchh, code);
@@ -455,27 +460,27 @@ static bool fetch_about_testament_handler(struct fetch_about_context *ctx)
msg.type = FETCH_DATA;
msg.data.header_or_data.buf = (const uint8_t *) buffer;
- slen = snprintf(buffer, sizeof buffer,
+ slen = snprintf(buffer, sizeof buffer,
"# Automatically generated by NetSurf build system\n\n");
msg.data.header_or_data.len = slen;
if (fetch_about_send_callback(&msg, ctx))
goto fetch_about_testament_handler_aborted;
-
- slen = snprintf(buffer, sizeof buffer,
+
+ slen = snprintf(buffer, sizeof buffer,
#if defined(WT_BRANCHISTRUNK) || defined(WT_BRANCHISMASTER)
"# This is a *DEVELOPMENT* build from the main line.\n\n"
#elif defined(WT_BRANCHISTAG) && (WT_MODIFIED == 0)
"# This is a tagged build of NetSurf\n"
#ifdef WT_TAGIS
- "# The tag used was '" WT_TAGIS "'\n\n"
+ "# The tag used was '" WT_TAGIS "'\n\n"
#else
- "\n"
+ "\n"
#endif
#elif defined(WT_NO_SVN) || defined(WT_NO_GIT)
"# This NetSurf was built outside of our revision "
"control environment.\n"
- "# This testament is therefore very useful.\n\n"
+ "# This testament is therefore not very useful.\n\n"
#else
"# This NetSurf was built from a branch (" WT_BRANCHPATH ").\n\n"
#endif
@@ -484,29 +489,29 @@ static bool fetch_about_testament_handler(struct fetch_about_context *ctx)
#endif
);
- msg.data.header_or_data.len = slen;
+ msg.data.header_or_data.len = slen;
if (fetch_about_send_callback(&msg, ctx))
goto fetch_about_testament_handler_aborted;
-
- slen = snprintf(buffer, sizeof buffer,
+
+ slen = snprintf(buffer, sizeof buffer,
"Built by %s (%s) from %s at revision %s on %s\n\n",
GECOS, USERNAME, WT_BRANCHPATH, WT_REVID, WT_COMPILEDATE);
msg.data.header_or_data.len = slen;
if (fetch_about_send_callback(&msg, ctx))
goto fetch_about_testament_handler_aborted;
-
- slen = snprintf(buffer, sizeof buffer,
+
+ slen = snprintf(buffer, sizeof buffer,
"Built on %s in %s\n\n",
WT_HOSTNAME, WT_ROOT);
msg.data.header_or_data.len = slen;
if (fetch_about_send_callback(&msg, ctx))
goto fetch_about_testament_handler_aborted;
-
+
if (WT_MODIFIED > 0) {
- slen = snprintf(buffer, sizeof buffer,
+ slen = snprintf(buffer, sizeof buffer,
"Working tree has %d modification%s\n\n",
WT_MODIFIED, WT_MODIFIED == 1 ? "" : "s");
} else {
@@ -517,7 +522,7 @@ static bool fetch_about_testament_handler(struct fetch_about_context *ctx)
msg.data.header_or_data.len = slen;
if (fetch_about_send_callback(&msg, ctx))
goto fetch_about_testament_handler_aborted;
-
+
for (i = 0; i < WT_MODIFIED; ++i) {
slen = snprintf(buffer, sizeof buffer,
" %s %s\n",
@@ -526,10 +531,10 @@ static bool fetch_about_testament_handler(struct fetch_about_context *ctx)
msg.data.header_or_data.len = slen;
if (fetch_about_send_callback(&msg, ctx))
goto fetch_about_testament_handler_aborted;
-
+
}
- msg.type = FETCH_FINISHED;
+ msg.type = FETCH_FINISHED;
fetch_about_send_callback(&msg, ctx);
return true;
@@ -604,15 +609,15 @@ struct about_handlers about_handler_list[] = {
fetch_about_imagecache_handler, true },
/* The default blank page */
{ "blank", SLEN("blank"), NULL,
- fetch_about_blank_handler, true }
+ fetch_about_blank_handler, true }
};
#define about_handler_list_len (sizeof(about_handler_list) / \
sizeof(struct about_handlers))
/**
- * List all the valid about: paths available
- *
+ * List all the valid about: paths available
+ *
* \param ctx The fetch context.
* \return true for sucess or false to generate an error.
*/
@@ -635,7 +640,7 @@ static bool fetch_about_about_handler(struct fetch_about_context *ctx)
msg.type = FETCH_DATA;
msg.data.header_or_data.buf = (const uint8_t *) buffer;
- slen = snprintf(buffer, sizeof buffer,
+ slen = snprintf(buffer, sizeof buffer,
"<html>\n<head>\n"
"<title>NetSurf List of About pages</title>\n"
"<link rel=\"stylesheet\" type=\"text/css\" "
@@ -655,11 +660,11 @@ static bool fetch_about_about_handler(struct fetch_about_context *ctx)
if (about_handler_list[abt_loop].hidden)
continue;
- res = snprintf(buffer + slen, sizeof buffer - slen,
- "<li><a href=\"about:%s\">about:%s</a></li>\n",
- about_handler_list[abt_loop].name,
+ res = snprintf(buffer + slen, sizeof buffer - slen,
+ "<li><a href=\"about:%s\">about:%s</a></li>\n",
+ about_handler_list[abt_loop].name,
about_handler_list[abt_loop].name);
- if (res <= 0)
+ if (res <= 0)
break; /* last option */
if (res >= (int)(sizeof buffer - slen)) {
@@ -674,7 +679,7 @@ static bool fetch_about_about_handler(struct fetch_about_context *ctx)
}
}
- slen += snprintf(buffer + slen, sizeof buffer - slen,
+ slen += snprintf(buffer + slen, sizeof buffer - slen,
"</ul>\n</body>\n</html>\n");
msg.data.header_or_data.len = slen;
@@ -698,8 +703,8 @@ static bool fetch_about_initialise(lwc_string *scheme)
lwc_error error;
for (abt_loop = 0; abt_loop < about_handler_list_len; abt_loop++) {
- error = lwc_intern_string(about_handler_list[abt_loop].name,
- about_handler_list[abt_loop].name_len,
+ error = lwc_intern_string(about_handler_list[abt_loop].name,
+ about_handler_list[abt_loop].name_len,
&about_handler_list[abt_loop].lname);
if (error != lwc_error_ok) {
while (abt_loop-- != 0) {
@@ -747,15 +752,15 @@ fetch_about_setup(struct fetch *fetchh,
path = nsurl_get_component(url, NSURL_PATH);
- for (handler_loop = 0;
- handler_loop < about_handler_list_len;
+ for (handler_loop = 0;
+ handler_loop < about_handler_list_len;
handler_loop++) {
ctx->handler = about_handler_list[handler_loop].handler;
- if (lwc_string_isequal(path,
- about_handler_list[handler_loop].lname,
+ if (lwc_string_isequal(path,
+ about_handler_list[handler_loop].lname,
&match) == lwc_error_ok && match) {
break;
- }
+ }
}
if (path != NULL)
diff --git a/desktop/print.c b/desktop/print.c
index 8f83f2d..9b3b297 100644
--- a/desktop/print.c
+++ b/desktop/print.c
@@ -17,8 +17,8 @@
*/
/** \file
- * Output-in-pages implementation
-*/
+ * Implementation of paginated output.
+ */
#include "utils/config.h"
@@ -194,7 +194,7 @@ bool print_apply_settings(hlcache_handle *content,
if (settings == NULL)
return false;
- /*Apply settings - adjust page size etc*/
+ /* Apply settings - adjust page size etc */
page_content_width = (settings->page_width -
FIXTOFLT(FSUB(settings->margins[MARGINLEFT],
@@ -243,8 +243,8 @@ bool print_cleanup(hlcache_handle *content, const struct printer *printer,
* \param configuration the requested configuration
* \param filename the filename or NULL
* \param font handling functions
- * \return print_settings in case if successful, NULL if unknown configuration \
- * or lack of memory.
+ * \return print_settings in case if successful, NULL if unknown
+ * configuration or lack of memory.
*/
struct print_settings *print_make_settings(print_configuration configuration,
const char *filename, const struct font_functions *font_func)
diff --git a/desktop/printer.h b/desktop/printer.h
index 3589223..7fda8bd 100644
--- a/desktop/printer.h
+++ b/desktop/printer.h
@@ -17,9 +17,11 @@
*/
/** \file
- * Printer interface - contains plotter to use, functions for
- * initialization, handling pages and cleaning up.
-*/
+ * Printer interface.
+ *
+ * Interface to generic plotters, initialization, handling pages and
+ * cleaning up.
+ */
#ifndef NETSURF_DESKTOP_PRINTER_H
#define NETSURF_DESKTOP_PRINTER_H
diff --git a/utils/nsoption.c b/utils/nsoption.c
index f6244cd..669b26c 100644
--- a/utils/nsoption.c
+++ b/utils/nsoption.c
@@ -602,7 +602,7 @@ nsoption_read(const char *path, struct nsoption_s *opts)
return NSERROR_NOT_FOUND;
}
- LOG(("Sucessfully opened '%s' for Options file", path));
+ LOG(("Successfully opened '%s' for Options file", path));
while (fgets(s, 100, fp)) {
char *colon, *value;
--
NetSurf Browser
8 years, 3 months
netsurf: branch master updated. release/3.2-81-gad22d54
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/ad22d5446cfc62cb69023...
...commit http://git.netsurf-browser.org/netsurf.git/commit/ad22d5446cfc62cb69023de...
...tree http://git.netsurf-browser.org/netsurf.git/tree/ad22d5446cfc62cb69023de2d...
The branch, master has been updated
via ad22d5446cfc62cb69023de2dcdd86b3b680fc98 (commit)
from bfd16c30fa70361fb87d258e71898d71ddea0483 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=ad22d5446cfc62cb690...
commit ad22d5446cfc62cb69023de2dcdd86b3b680fc98
Author: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Commit: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Add three languages which now have OS4 language drivers.
diff --git a/amiga/resources/LangNames b/amiga/resources/LangNames
index 51c00e7..359a0d0 100755
--- a/amiga/resources/LangNames
+++ b/amiga/resources/LangNames
@@ -16,6 +16,7 @@ belarusian:be
bosnian:bs
bulgarian:bg
catalan:ca
+chinese:zh
croatian:hr
czech:cs
danish:da
@@ -35,6 +36,8 @@ hungarian:hu
icelandic:is
irish:ga
italian:it
+japanese:ja
+korean:ko
latvian:lv
lithuanian:lt
macedonian:mk
@@ -57,3 +60,4 @@ thai:th
turkish:tr
ukrainian:uk
welsh:cy
+
-----------------------------------------------------------------------
Summary of changes:
amiga/resources/LangNames | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/amiga/resources/LangNames b/amiga/resources/LangNames
index 51c00e7..359a0d0 100755
--- a/amiga/resources/LangNames
+++ b/amiga/resources/LangNames
@@ -16,6 +16,7 @@ belarusian:be
bosnian:bs
bulgarian:bg
catalan:ca
+chinese:zh
croatian:hr
czech:cs
danish:da
@@ -35,6 +36,8 @@ hungarian:hu
icelandic:is
irish:ga
italian:it
+japanese:ja
+korean:ko
latvian:lv
lithuanian:lt
macedonian:mk
@@ -57,3 +60,4 @@ thai:th
turkish:tr
ukrainian:uk
welsh:cy
+
--
NetSurf Browser
8 years, 3 months
netsurf: branch master updated. release/3.2-80-gbfd16c3
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/bfd16c30fa70361fb87d2...
...commit http://git.netsurf-browser.org/netsurf.git/commit/bfd16c30fa70361fb87d258...
...tree http://git.netsurf-browser.org/netsurf.git/tree/bfd16c30fa70361fb87d258e7...
The branch, master has been updated
via bfd16c30fa70361fb87d258e71898d71ddea0483 (commit)
from a32aef2f40156217649703e8a6b81d256883da6c (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=bfd16c30fa70361fb87...
commit bfd16c30fa70361fb87d258e71898d71ddea0483
Author: Vincent Sanders <vince(a)kyllikki.org>
Commit: Vincent Sanders <vince(a)kyllikki.org>
update default mac os X version in the correct place
diff --git a/cocoa/Makefile.defaults b/cocoa/Makefile.defaults
index 501d175..50da667 100644
--- a/cocoa/Makefile.defaults
+++ b/cocoa/Makefile.defaults
@@ -29,7 +29,7 @@ NETSURF_USE_JPEG := NO
NETSURF_USE_IMAGEIO := YES
DEVELOPER_PATH := /Developer
-MACOSX_VERSION := 10.5
+MACOSX_VERSION := 10.6
SDK_VERSION := $(MACOSX_VERSION)
# Optimisation levels
diff --git a/cocoa/Makefile.target b/cocoa/Makefile.target
index eae3fae..815243c 100644
--- a/cocoa/Makefile.target
+++ b/cocoa/Makefile.target
@@ -25,8 +25,6 @@ endif
# for timerisset()
CFLAGS += -D_DARWIN_C_SOURCE
-MACOSX_VERSION ?= 10.6
-SDK_VERSION ?= $(MACOSX_VERSION)
SDK_PATH ?= $(DEVELOPER_PATH)/SDKs/MacOSX$(SDK_VERSION).sdk
SDK_FLAGS := -isysroot $(SDK_PATH) -mmacosx-version-min=$(MACOSX_VERSION)
CFLAGS := $(SDK_FLAGS) $(CFLAGS)
-----------------------------------------------------------------------
Summary of changes:
cocoa/Makefile.defaults | 2 +-
cocoa/Makefile.target | 2 --
2 files changed, 1 insertions(+), 3 deletions(-)
diff --git a/cocoa/Makefile.defaults b/cocoa/Makefile.defaults
index 501d175..50da667 100644
--- a/cocoa/Makefile.defaults
+++ b/cocoa/Makefile.defaults
@@ -29,7 +29,7 @@ NETSURF_USE_JPEG := NO
NETSURF_USE_IMAGEIO := YES
DEVELOPER_PATH := /Developer
-MACOSX_VERSION := 10.5
+MACOSX_VERSION := 10.6
SDK_VERSION := $(MACOSX_VERSION)
# Optimisation levels
diff --git a/cocoa/Makefile.target b/cocoa/Makefile.target
index eae3fae..815243c 100644
--- a/cocoa/Makefile.target
+++ b/cocoa/Makefile.target
@@ -25,8 +25,6 @@ endif
# for timerisset()
CFLAGS += -D_DARWIN_C_SOURCE
-MACOSX_VERSION ?= 10.6
-SDK_VERSION ?= $(MACOSX_VERSION)
SDK_PATH ?= $(DEVELOPER_PATH)/SDKs/MacOSX$(SDK_VERSION).sdk
SDK_FLAGS := -isysroot $(SDK_PATH) -mmacosx-version-min=$(MACOSX_VERSION)
CFLAGS := $(SDK_FLAGS) $(CFLAGS)
--
NetSurf Browser
8 years, 3 months
netsurf: branch master updated. release/3.2-79-ga32aef2
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/a32aef2f4015621764970...
...commit http://git.netsurf-browser.org/netsurf.git/commit/a32aef2f40156217649703e...
...tree http://git.netsurf-browser.org/netsurf.git/tree/a32aef2f40156217649703e8a...
The branch, master has been updated
via a32aef2f40156217649703e8a6b81d256883da6c (commit)
via 57f8cf6433003cafa1a9b359e1d119c3373b8f87 (commit)
from 49fd5ea238891a7efcd9c32fe2c9e6bc9c2ed180 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=a32aef2f40156217649...
commit a32aef2f40156217649703e8a6b81d256883da6c
Author: Vincent Sanders <vince(a)kyllikki.org>
Commit: Vincent Sanders <vince(a)kyllikki.org>
update to install OS packages on mac os x with macports
diff --git a/Docs/env.sh b/Docs/env.sh
index 89f9add..eb1da0d 100644
--- a/Docs/env.sh
+++ b/Docs/env.sh
@@ -62,6 +62,11 @@ if [ "x${TARGET_ABI}" = "xHaiku" ]; then
# tools required to build the browser
NS_TOOLS=""
NS_FRONTEND_LIBS=""
+elif [ "x${TARGET_ABI}" = "xDarwin" ]; then
+ # tools required to build the browser
+ NS_TOOLS=""
+ # libraries required for the Darwin target abi
+ NS_FRONTEND_LIBS="libsvgtiny libnsfb"
elif [ "x${TARGET_ABI}" = "xriscos" ]; then
# tools required to build the browser
NS_TOOLS="nsgenbind"
@@ -128,6 +133,12 @@ else
NS_GTK_GEN="gtk+ 2 toolkit library, librsvg2 library"
fi
+NS_DEV_MACPORT="git expat openssl curl libjpeg-turbo libpng"
+
+ns-macport-install()
+{
+ PATH=/opt/local/bin:/opt/local/sbin:$PATH sudo /opt/local/bin/port install $(echo ${NS_DEV_MACPORT})
+}
# Genertic OS package install
# looks for package managers and tries to use them if present
@@ -139,6 +150,8 @@ ns-package-install()
ns-yum-install
elif [ -x "/bin/pkgman" ]; then
ns-pkgman-install
+ elif [ -x "/opt/local/bin/port" ]; then
+ ns-macport-install
else
echo "Unable to determine OS packaging system in use."
echo "Please ensure development packages are installed for:"
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=57f8cf6433003cafa1a...
commit 57f8cf6433003cafa1a9b359e1d119c3373b8f87
Author: Vincent Sanders <vince(a)kyllikki.org>
Commit: Vincent Sanders <vince(a)kyllikki.org>
As we no longer build the PPC version the default SDK version should be 10.6 for snow leopard compatability
diff --git a/cocoa/Makefile.target b/cocoa/Makefile.target
index d5b983a..eae3fae 100644
--- a/cocoa/Makefile.target
+++ b/cocoa/Makefile.target
@@ -25,7 +25,7 @@ endif
# for timerisset()
CFLAGS += -D_DARWIN_C_SOURCE
-MACOSX_VERSION ?= 10.5
+MACOSX_VERSION ?= 10.6
SDK_VERSION ?= $(MACOSX_VERSION)
SDK_PATH ?= $(DEVELOPER_PATH)/SDKs/MacOSX$(SDK_VERSION).sdk
SDK_FLAGS := -isysroot $(SDK_PATH) -mmacosx-version-min=$(MACOSX_VERSION)
-----------------------------------------------------------------------
Summary of changes:
Docs/env.sh | 13 +++++++++++++
cocoa/Makefile.target | 2 +-
2 files changed, 14 insertions(+), 1 deletions(-)
diff --git a/Docs/env.sh b/Docs/env.sh
index 89f9add..eb1da0d 100644
--- a/Docs/env.sh
+++ b/Docs/env.sh
@@ -62,6 +62,11 @@ if [ "x${TARGET_ABI}" = "xHaiku" ]; then
# tools required to build the browser
NS_TOOLS=""
NS_FRONTEND_LIBS=""
+elif [ "x${TARGET_ABI}" = "xDarwin" ]; then
+ # tools required to build the browser
+ NS_TOOLS=""
+ # libraries required for the Darwin target abi
+ NS_FRONTEND_LIBS="libsvgtiny libnsfb"
elif [ "x${TARGET_ABI}" = "xriscos" ]; then
# tools required to build the browser
NS_TOOLS="nsgenbind"
@@ -128,6 +133,12 @@ else
NS_GTK_GEN="gtk+ 2 toolkit library, librsvg2 library"
fi
+NS_DEV_MACPORT="git expat openssl curl libjpeg-turbo libpng"
+
+ns-macport-install()
+{
+ PATH=/opt/local/bin:/opt/local/sbin:$PATH sudo /opt/local/bin/port install $(echo ${NS_DEV_MACPORT})
+}
# Genertic OS package install
# looks for package managers and tries to use them if present
@@ -139,6 +150,8 @@ ns-package-install()
ns-yum-install
elif [ -x "/bin/pkgman" ]; then
ns-pkgman-install
+ elif [ -x "/opt/local/bin/port" ]; then
+ ns-macport-install
else
echo "Unable to determine OS packaging system in use."
echo "Please ensure development packages are installed for:"
diff --git a/cocoa/Makefile.target b/cocoa/Makefile.target
index d5b983a..eae3fae 100644
--- a/cocoa/Makefile.target
+++ b/cocoa/Makefile.target
@@ -25,7 +25,7 @@ endif
# for timerisset()
CFLAGS += -D_DARWIN_C_SOURCE
-MACOSX_VERSION ?= 10.5
+MACOSX_VERSION ?= 10.6
SDK_VERSION ?= $(MACOSX_VERSION)
SDK_PATH ?= $(DEVELOPER_PATH)/SDKs/MacOSX$(SDK_VERSION).sdk
SDK_FLAGS := -isysroot $(SDK_PATH) -mmacosx-version-min=$(MACOSX_VERSION)
--
NetSurf Browser
8 years, 3 months