libnsfb: branch master updated. release/0.1.0-6-g797266e
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/libnsfb.git/shortlog/797266ea930ca103e7fa7...
...commit http://git.netsurf-browser.org/libnsfb.git/commit/797266ea930ca103e7fa7a2...
...tree http://git.netsurf-browser.org/libnsfb.git/tree/797266ea930ca103e7fa7a2e6...
The branch, master has been updated
via 797266ea930ca103e7fa7a2e683158d935683f8f (commit)
from 8e262181e6f85bc89dfed652d971a876c7e6e153 (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/libnsfb.git/commit/?id=797266ea930ca103e7f...
commit 797266ea930ca103e7fa7a2e683158d935683f8f
Author: Michael Drake <tlsa(a)netsurf-browser.org>
Commit: Michael Drake <tlsa(a)netsurf-browser.org>
Avoid repeating some calculations.
diff --git a/include/palette.h b/include/palette.h
index b48d5f3..a4b9f77 100644
--- a/include/palette.h
+++ b/include/palette.h
@@ -66,18 +66,22 @@ static inline uint8_t nsfb_palette_best_match(struct nsfb_palette_s *palette,
int cur_distance;
int best_distance = INT_MAX;
+ int r = ( c & 0xFF);
+ int g = ((c >> 8) & 0xFF);
+ int b = ((c >> 16) & 0xFF);
+
switch (palette->type) {
case NSFB_PALETTE_NSFB_8BPP:
/* Index into colour cube part */
- dr = ((( c & 0xFF) * 5) + 128) / 256;
- dg = ((((c >> 8) & 0xFF) * 7) + 128) / 256;
- db = ((((c >> 16) & 0xFF) * 4) + 128) / 256;
+ dr = ((r * 5) + 128) / 256;
+ dg = ((g * 7) + 128) / 256;
+ db = ((b * 4) + 128) / 256;
col = 40 * dr + 5 * dg + db;
palent = palette->data[col];
- dr = ( c & 0xFF) - ( palent & 0xFF);
- dg = ((c >> 8) & 0xFF) - ((palent >> 8 ) & 0xFF);
- db = ((c >> 16) & 0xFF) - ((palent >> 16) & 0xFF);
+ dr = r - ( palent & 0xFF);
+ dg = g - ((palent >> 8) & 0xFF);
+ db = b - ((palent >> 16) & 0xFF);
cur_distance = (dr * dr) + (dg * dg) + (db * db);
best_col = col;
@@ -87,14 +91,12 @@ static inline uint8_t nsfb_palette_best_match(struct nsfb_palette_s *palette,
*b_error = db;
/* Index into grayscale part */
- col = (( c & 0xFF) +
- ((c >> 8) & 0xFF) +
- ((c >> 16) & 0xFF) + (45 / 2)) / (15 * 3) - 1 + 240;
+ col = (r + g + b + (45 / 2)) / (15 * 3) - 1 + 240;
palent = palette->data[col];
- dr = ( c & 0xFF) - ( palent & 0xFF);
- dg = ((c >> 8) & 0xFF) - ((palent >> 8) & 0xFF);
- db = ((c >> 16) & 0xFF) - ((palent >> 16) & 0xFF);
+ dr = r - (palent & 0xFF);
+ dg = g - (palent & 0xFF);
+ db = b - (palent & 0xFF);
cur_distance = (dr * dr) + (dg * dg) + (db * db);
if (cur_distance < best_distance) {
best_col = col;
@@ -109,9 +111,9 @@ static inline uint8_t nsfb_palette_best_match(struct nsfb_palette_s *palette,
for (col = 0; col <= palette->last; col++) {
palent = palette->data[col];
- dr = ( c & 0xFF) - ( palent & 0xFF);
- dg = ((c >> 8) & 0xFF) - ((palent >> 8) & 0xFF);
- db = ((c >> 16) & 0xFF) - ((palent >> 16) & 0xFF);
+ dr = r - ( palent & 0xFF);
+ dg = g - ((palent >> 8) & 0xFF);
+ db = b - ((palent >> 16) & 0xFF);
cur_distance = (dr * dr) + (dg * dg) + (db * db);
if (cur_distance < best_distance) {
best_distance = cur_distance;
-----------------------------------------------------------------------
Summary of changes:
include/palette.h | 32 +++++++++++++++++---------------
1 files changed, 17 insertions(+), 15 deletions(-)
diff --git a/include/palette.h b/include/palette.h
index b48d5f3..a4b9f77 100644
--- a/include/palette.h
+++ b/include/palette.h
@@ -66,18 +66,22 @@ static inline uint8_t nsfb_palette_best_match(struct nsfb_palette_s *palette,
int cur_distance;
int best_distance = INT_MAX;
+ int r = ( c & 0xFF);
+ int g = ((c >> 8) & 0xFF);
+ int b = ((c >> 16) & 0xFF);
+
switch (palette->type) {
case NSFB_PALETTE_NSFB_8BPP:
/* Index into colour cube part */
- dr = ((( c & 0xFF) * 5) + 128) / 256;
- dg = ((((c >> 8) & 0xFF) * 7) + 128) / 256;
- db = ((((c >> 16) & 0xFF) * 4) + 128) / 256;
+ dr = ((r * 5) + 128) / 256;
+ dg = ((g * 7) + 128) / 256;
+ db = ((b * 4) + 128) / 256;
col = 40 * dr + 5 * dg + db;
palent = palette->data[col];
- dr = ( c & 0xFF) - ( palent & 0xFF);
- dg = ((c >> 8) & 0xFF) - ((palent >> 8 ) & 0xFF);
- db = ((c >> 16) & 0xFF) - ((palent >> 16) & 0xFF);
+ dr = r - ( palent & 0xFF);
+ dg = g - ((palent >> 8) & 0xFF);
+ db = b - ((palent >> 16) & 0xFF);
cur_distance = (dr * dr) + (dg * dg) + (db * db);
best_col = col;
@@ -87,14 +91,12 @@ static inline uint8_t nsfb_palette_best_match(struct nsfb_palette_s *palette,
*b_error = db;
/* Index into grayscale part */
- col = (( c & 0xFF) +
- ((c >> 8) & 0xFF) +
- ((c >> 16) & 0xFF) + (45 / 2)) / (15 * 3) - 1 + 240;
+ col = (r + g + b + (45 / 2)) / (15 * 3) - 1 + 240;
palent = palette->data[col];
- dr = ( c & 0xFF) - ( palent & 0xFF);
- dg = ((c >> 8) & 0xFF) - ((palent >> 8) & 0xFF);
- db = ((c >> 16) & 0xFF) - ((palent >> 16) & 0xFF);
+ dr = r - (palent & 0xFF);
+ dg = g - (palent & 0xFF);
+ db = b - (palent & 0xFF);
cur_distance = (dr * dr) + (dg * dg) + (db * db);
if (cur_distance < best_distance) {
best_col = col;
@@ -109,9 +111,9 @@ static inline uint8_t nsfb_palette_best_match(struct nsfb_palette_s *palette,
for (col = 0; col <= palette->last; col++) {
palent = palette->data[col];
- dr = ( c & 0xFF) - ( palent & 0xFF);
- dg = ((c >> 8) & 0xFF) - ((palent >> 8) & 0xFF);
- db = ((c >> 16) & 0xFF) - ((palent >> 16) & 0xFF);
+ dr = r - ( palent & 0xFF);
+ dg = g - ((palent >> 8) & 0xFF);
+ db = b - ((palent >> 16) & 0xFF);
cur_distance = (dr * dr) + (dg * dg) + (db * db);
if (cur_distance < best_distance) {
best_distance = cur_distance;
--
NetSurf Framebuffer library
9 years, 3 months
netsurf: branch master updated. release/3.0-692-g2277fb0
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/2277fb0284d50d378c2b0...
...commit http://git.netsurf-browser.org/netsurf.git/commit/2277fb0284d50d378c2b0ca...
...tree http://git.netsurf-browser.org/netsurf.git/tree/2277fb0284d50d378c2b0ca03...
The branch, master has been updated
via 2277fb0284d50d378c2b0ca03798bf1512769eea (commit)
from d3aac06e3f7a1fb68709013a987d696935d96d23 (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=2277fb0284d50d378c2...
commit 2277fb0284d50d378c2b0ca03798bf1512769eea
Author: Michael Drake <tlsa(a)netsurf-browser.org>
Commit: Michael Drake <tlsa(a)netsurf-browser.org>
Apply plot offsets to overlays.
diff --git a/desktop/treeview.c b/desktop/treeview.c
index fed8a48..767f1c7 100644
--- a/desktop/treeview.c
+++ b/desktop/treeview.c
@@ -1654,8 +1654,8 @@ nserror treeview_expand(treeview *tree, bool only_folders)
/* Exported interface, documented in treeview.h */
-void treeview_redraw(treeview *tree, int x, int y, struct rect *clip,
- const struct redraw_context *ctx)
+void treeview_redraw(treeview *tree, const int x, const int y,
+ struct rect *clip, const struct redraw_context *ctx)
{
struct redraw_context new_ctx = *ctx;
treeview_node *node, *root, *next;
@@ -1740,7 +1740,7 @@ void treeview_redraw(treeview *tree, int x, int y, struct rect *clip,
node->type == TREE_NODE_ENTRY);
count++;
- inset = node->inset;
+ inset = x + node->inset;
height = (node->type == TREE_NODE_ENTRY) ? node->height :
tree_g.line_height;
@@ -1878,8 +1878,8 @@ void treeview_redraw(treeview *tree, int x, int y, struct rect *clip,
if (tree->move.target_pos != TV_TARGET_NONE &&
treeview_res[TREE_RES_ARROW].ready) {
/* Got a MOVE drag; render move indicator arrow */
- data.x = tree->move.target_area.x0;
- data.y = tree->move.target_area.y0;
+ data.x = tree->move.target_area.x0 + x;
+ data.y = tree->move.target_area.y0 + y;
data.background_colour = plot_style_even.bg.fill_colour;
content_redraw(treeview_res[TREE_RES_ARROW].c,
@@ -1888,7 +1888,7 @@ void treeview_redraw(treeview *tree, int x, int y, struct rect *clip,
} else if (tree->edit.textarea != NULL) {
/* Edit in progress; render textarea */
textarea_redraw(tree->edit.textarea,
- tree->edit.x, tree->edit.y,
+ tree->edit.x + x, tree->edit.y + y,
plot_style_even.bg.fill_colour, 1.0,
&r, &new_ctx);
}
-----------------------------------------------------------------------
Summary of changes:
desktop/treeview.c | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/desktop/treeview.c b/desktop/treeview.c
index fed8a48..767f1c7 100644
--- a/desktop/treeview.c
+++ b/desktop/treeview.c
@@ -1654,8 +1654,8 @@ nserror treeview_expand(treeview *tree, bool only_folders)
/* Exported interface, documented in treeview.h */
-void treeview_redraw(treeview *tree, int x, int y, struct rect *clip,
- const struct redraw_context *ctx)
+void treeview_redraw(treeview *tree, const int x, const int y,
+ struct rect *clip, const struct redraw_context *ctx)
{
struct redraw_context new_ctx = *ctx;
treeview_node *node, *root, *next;
@@ -1740,7 +1740,7 @@ void treeview_redraw(treeview *tree, int x, int y, struct rect *clip,
node->type == TREE_NODE_ENTRY);
count++;
- inset = node->inset;
+ inset = x + node->inset;
height = (node->type == TREE_NODE_ENTRY) ? node->height :
tree_g.line_height;
@@ -1878,8 +1878,8 @@ void treeview_redraw(treeview *tree, int x, int y, struct rect *clip,
if (tree->move.target_pos != TV_TARGET_NONE &&
treeview_res[TREE_RES_ARROW].ready) {
/* Got a MOVE drag; render move indicator arrow */
- data.x = tree->move.target_area.x0;
- data.y = tree->move.target_area.y0;
+ data.x = tree->move.target_area.x0 + x;
+ data.y = tree->move.target_area.y0 + y;
data.background_colour = plot_style_even.bg.fill_colour;
content_redraw(treeview_res[TREE_RES_ARROW].c,
@@ -1888,7 +1888,7 @@ void treeview_redraw(treeview *tree, int x, int y, struct rect *clip,
} else if (tree->edit.textarea != NULL) {
/* Edit in progress; render textarea */
textarea_redraw(tree->edit.textarea,
- tree->edit.x, tree->edit.y,
+ tree->edit.x + x, tree->edit.y + y,
plot_style_even.bg.fill_colour, 1.0,
&r, &new_ctx);
}
--
NetSurf Browser
9 years, 3 months
netsurf: branch master updated. release/3.0-691-gd3aac06
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/d3aac06e3f7a1fb687090...
...commit http://git.netsurf-browser.org/netsurf.git/commit/d3aac06e3f7a1fb68709013...
...tree http://git.netsurf-browser.org/netsurf.git/tree/d3aac06e3f7a1fb68709013a9...
The branch, master has been updated
via d3aac06e3f7a1fb68709013a987d696935d96d23 (commit)
via ef24e5ce9ef10d121c6ab95c2a124a71f5943998 (commit)
from f6b1227c8dff395fc30271b71a150ae3501ba68a (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=d3aac06e3f7a1fb6870...
commit d3aac06e3f7a1fb68709013a987d696935d96d23
Author: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Commit: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Correct some more offsets
diff --git a/amiga/tree.c b/amiga/tree.c
index 8cd155b..f2acc2d 100644
--- a/amiga/tree.c
+++ b/amiga/tree.c
@@ -1272,7 +1272,7 @@ static void ami_tree_redraw_req_dr(void *p)
y = pos_y;
}
- tree_draw(twin->tree, 0 - pos_x, 0 - pos_y,
+ tree_draw(twin->tree, bbox->Left - pos_x, bbox->Top - pos_y,
atrr_data->x, atrr_data->y,
atrr_data->width, atrr_data->height, &ctx);
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=ef24e5ce9ef10d121c6...
commit ef24e5ce9ef10d121c6ab95c2a124a71f5943998
Author: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Commit: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Fix bitmap offsets in direct render mode by forcing use of BltBitMap
diff --git a/amiga/plotters.c b/amiga/plotters.c
index 42b5239..6683fc5 100755
--- a/amiga/plotters.c
+++ b/amiga/plotters.c
@@ -690,7 +690,8 @@ static bool ami_bitmap(int x, int y, int width, int height, struct bitmap *bitma
LOG(("[ami_plotter] ami_bitmap() got native bitmap"));
#endif
- if((GfxBase->LibNode.lib_Version >= 53) && (palette_mapped == false))
+ if((GfxBase->LibNode.lib_Version >= 53) && (palette_mapped == false) &&
+ (nsoption_bool(direct_render) == false))
{
#ifdef __amigaos4__
uint32 comptype = COMPOSITE_Src_Over_Dest;
diff --git a/amiga/tree.c b/amiga/tree.c
index 28eebcb..8cd155b 100644
--- a/amiga/tree.c
+++ b/amiga/tree.c
@@ -1272,8 +1272,9 @@ static void ami_tree_redraw_req_dr(void *p)
y = pos_y;
}
- tree_draw(twin->tree, - x, - y,
- bbox->Left, bbox->Top, width, height, &ctx);
+ tree_draw(twin->tree, 0 - pos_x, 0 - pos_y,
+ atrr_data->x, atrr_data->y,
+ atrr_data->width, atrr_data->height, &ctx);
FreeVec(atrr_data);
ami_update_pointer(twin->win, GUI_POINTER_DEFAULT);
-----------------------------------------------------------------------
Summary of changes:
amiga/plotters.c | 3 ++-
amiga/tree.c | 5 +++--
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/amiga/plotters.c b/amiga/plotters.c
index 42b5239..6683fc5 100755
--- a/amiga/plotters.c
+++ b/amiga/plotters.c
@@ -690,7 +690,8 @@ static bool ami_bitmap(int x, int y, int width, int height, struct bitmap *bitma
LOG(("[ami_plotter] ami_bitmap() got native bitmap"));
#endif
- if((GfxBase->LibNode.lib_Version >= 53) && (palette_mapped == false))
+ if((GfxBase->LibNode.lib_Version >= 53) && (palette_mapped == false) &&
+ (nsoption_bool(direct_render) == false))
{
#ifdef __amigaos4__
uint32 comptype = COMPOSITE_Src_Over_Dest;
diff --git a/amiga/tree.c b/amiga/tree.c
index 28eebcb..f2acc2d 100644
--- a/amiga/tree.c
+++ b/amiga/tree.c
@@ -1272,8 +1272,9 @@ static void ami_tree_redraw_req_dr(void *p)
y = pos_y;
}
- tree_draw(twin->tree, - x, - y,
- bbox->Left, bbox->Top, width, height, &ctx);
+ tree_draw(twin->tree, bbox->Left - pos_x, bbox->Top - pos_y,
+ atrr_data->x, atrr_data->y,
+ atrr_data->width, atrr_data->height, &ctx);
FreeVec(atrr_data);
ami_update_pointer(twin->win, GUI_POINTER_DEFAULT);
--
NetSurf Browser
9 years, 3 months
netsurf: branch master updated. release/3.0-689-gf6b1227
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/f6b1227c8dff395fc3027...
...commit http://git.netsurf-browser.org/netsurf.git/commit/f6b1227c8dff395fc30271b...
...tree http://git.netsurf-browser.org/netsurf.git/tree/f6b1227c8dff395fc30271b71...
The branch, master has been updated
via f6b1227c8dff395fc30271b71a150ae3501ba68a (commit)
from 1023fbf927dd03c425a1dde7920da649f86dae3d (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=f6b1227c8dff395fc30...
commit f6b1227c8dff395fc30271b71a150ae3501ba68a
Author: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Commit: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Allow direct render of treeview for debug purposes only.
diff --git a/amiga/tree.c b/amiga/tree.c
index 69fe3e8..28eebcb 100644
--- a/amiga/tree.c
+++ b/amiga/tree.c
@@ -1227,6 +1227,61 @@ void ami_tree_draw(struct treeview_window *twin)
ami_tree_redraw_request(x, y, bbox->Width, bbox->Height, twin);
}
+static void ami_tree_redraw_req_dr(void *p)
+{
+ struct ami_tree_redraw_req *atrr_data = (struct ami_tree_redraw_req *)p;
+ int x = atrr_data->x;
+ int y = atrr_data->y;
+ int width = atrr_data->width;
+ int height = atrr_data->height;
+ struct treeview_window *twin = atrr_data->twin;
+ struct IBox *bbox;
+ int pos_x, pos_y;
+ struct RastPort *temprp;
+ struct redraw_context ctx = {
+ .interactive = true,
+ .background_images = true,
+ .plot = &amiplot
+ };
+
+ if(!twin->win) return;
+
+ ami_update_pointer(twin->win, GUI_POINTER_WAIT);
+
+ glob = &twin->globals;
+ temprp = glob->rp;
+ glob->rp = twin->win->RPort;
+
+ GetAttr(SPACE_AreaBox,twin->objects[GID_BROWSER], (ULONG *)&bbox);
+ GetAttr(SCROLLER_Top, twin->objects[OID_HSCROLL], (ULONG *)&pos_x);
+ GetAttr(SCROLLER_Top, twin->objects[OID_VSCROLL], (ULONG *)&pos_y);
+
+ x += bbox->Left;
+ y += bbox->Top;
+
+ if(x - pos_x + width > bbox->Width) width = bbox->Width - (x - pos_x);
+ if(y - pos_y + height > bbox->Height) height = bbox->Height - (y - pos_y);
+
+ if(x < pos_x) {
+ width -= pos_x - x;
+ x = pos_x;
+ }
+
+ if(y < pos_y) {
+ height -= pos_y - y;
+ y = pos_y;
+ }
+
+ tree_draw(twin->tree, - x, - y,
+ bbox->Left, bbox->Top, width, height, &ctx);
+
+ FreeVec(atrr_data);
+ ami_update_pointer(twin->win, GUI_POINTER_DEFAULT);
+ ami_clearclipreg(glob);
+ glob->rp = temprp;
+ glob = &browserglob;
+}
+
static void ami_tree_redraw_req(void *p)
{
struct ami_tree_redraw_req *atrr_data = (struct ami_tree_redraw_req *)p;
@@ -1296,6 +1351,7 @@ static void ami_tree_redraw_req(void *p)
FreeVec(atrr_data);
ami_update_pointer(twin->win, GUI_POINTER_DEFAULT);
+ ami_clearclipreg(glob);
glob = &browserglob;
}
@@ -1311,7 +1367,9 @@ void ami_tree_redraw_request(int x, int y, int width, int height, void *data)
/**TODO: Queue these requests properly like the main browser code does
**/
-
- schedule(0, ami_tree_redraw_req, atrr_data);
-}
+ if(nsoption_bool(direct_render) == false)
+ schedule(0, ami_tree_redraw_req, atrr_data);
+ else
+ schedule(0, ami_tree_redraw_req_dr, atrr_data);
+}
-----------------------------------------------------------------------
Summary of changes:
amiga/tree.c | 64 +++++++++++++++++++++++++++++++++++++++++++++++++++++++--
1 files changed, 61 insertions(+), 3 deletions(-)
diff --git a/amiga/tree.c b/amiga/tree.c
index 69fe3e8..28eebcb 100644
--- a/amiga/tree.c
+++ b/amiga/tree.c
@@ -1227,6 +1227,61 @@ void ami_tree_draw(struct treeview_window *twin)
ami_tree_redraw_request(x, y, bbox->Width, bbox->Height, twin);
}
+static void ami_tree_redraw_req_dr(void *p)
+{
+ struct ami_tree_redraw_req *atrr_data = (struct ami_tree_redraw_req *)p;
+ int x = atrr_data->x;
+ int y = atrr_data->y;
+ int width = atrr_data->width;
+ int height = atrr_data->height;
+ struct treeview_window *twin = atrr_data->twin;
+ struct IBox *bbox;
+ int pos_x, pos_y;
+ struct RastPort *temprp;
+ struct redraw_context ctx = {
+ .interactive = true,
+ .background_images = true,
+ .plot = &amiplot
+ };
+
+ if(!twin->win) return;
+
+ ami_update_pointer(twin->win, GUI_POINTER_WAIT);
+
+ glob = &twin->globals;
+ temprp = glob->rp;
+ glob->rp = twin->win->RPort;
+
+ GetAttr(SPACE_AreaBox,twin->objects[GID_BROWSER], (ULONG *)&bbox);
+ GetAttr(SCROLLER_Top, twin->objects[OID_HSCROLL], (ULONG *)&pos_x);
+ GetAttr(SCROLLER_Top, twin->objects[OID_VSCROLL], (ULONG *)&pos_y);
+
+ x += bbox->Left;
+ y += bbox->Top;
+
+ if(x - pos_x + width > bbox->Width) width = bbox->Width - (x - pos_x);
+ if(y - pos_y + height > bbox->Height) height = bbox->Height - (y - pos_y);
+
+ if(x < pos_x) {
+ width -= pos_x - x;
+ x = pos_x;
+ }
+
+ if(y < pos_y) {
+ height -= pos_y - y;
+ y = pos_y;
+ }
+
+ tree_draw(twin->tree, - x, - y,
+ bbox->Left, bbox->Top, width, height, &ctx);
+
+ FreeVec(atrr_data);
+ ami_update_pointer(twin->win, GUI_POINTER_DEFAULT);
+ ami_clearclipreg(glob);
+ glob->rp = temprp;
+ glob = &browserglob;
+}
+
static void ami_tree_redraw_req(void *p)
{
struct ami_tree_redraw_req *atrr_data = (struct ami_tree_redraw_req *)p;
@@ -1296,6 +1351,7 @@ static void ami_tree_redraw_req(void *p)
FreeVec(atrr_data);
ami_update_pointer(twin->win, GUI_POINTER_DEFAULT);
+ ami_clearclipreg(glob);
glob = &browserglob;
}
@@ -1311,7 +1367,9 @@ void ami_tree_redraw_request(int x, int y, int width, int height, void *data)
/**TODO: Queue these requests properly like the main browser code does
**/
-
- schedule(0, ami_tree_redraw_req, atrr_data);
-}
+ if(nsoption_bool(direct_render) == false)
+ schedule(0, ami_tree_redraw_req, atrr_data);
+ else
+ schedule(0, ami_tree_redraw_req_dr, atrr_data);
+}
--
NetSurf Browser
9 years, 3 months
netsurf: branch master updated. release/3.0-688-g1023fbf
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/1023fbf927dd03c425a1d...
...commit http://git.netsurf-browser.org/netsurf.git/commit/1023fbf927dd03c425a1dde...
...tree http://git.netsurf-browser.org/netsurf.git/tree/1023fbf927dd03c425a1dde79...
The branch, master has been updated
via 1023fbf927dd03c425a1dde7920da649f86dae3d (commit)
from 5b02d2b681398a5ba0eb8831f0829388e5be819b (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=1023fbf927dd03c425a...
commit 1023fbf927dd03c425a1dde7920da649f86dae3d
Author: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Commit: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Create the hotlist menu/toolbar folders if they don't exist.
diff --git a/amiga/hotlist.c b/amiga/hotlist.c
index 70f0143..b67ba22 100755
--- a/amiga/hotlist.c
+++ b/amiga/hotlist.c
@@ -27,6 +27,7 @@ struct ami_hotlist_ctx {
int item;
const char *folder; /* folder we're interested in */
bool in_menu; /* set if we are in that folder */
+ bool found; /* set if the folder is found */
bool (*cb)(void *userdata, int level, int item, const char *title, nsurl *url, bool folder);
};
@@ -54,8 +55,10 @@ static nserror ami_hotlist_folder_enter_cb(void *ctx, const char *title)
if(menu_ctx->cb(menu_ctx->userdata, menu_ctx->level, menu_ctx->item, title, NULL, true) == true)
menu_ctx->item++;
} else {
- if((menu_ctx->level == 0) && (strcmp(title, menu_ctx->folder) == 0))
+ if((menu_ctx->level == 0) && (strcmp(title, menu_ctx->folder) == 0)) {
menu_ctx->in_menu = true;
+ menu_ctx->found = true;
+ }
}
menu_ctx->level++;
return NSERROR_OK;
@@ -88,17 +91,24 @@ static nserror ami_hotlist_folder_leave_cb(void *ctx)
nserror ami_hotlist_scan(void *userdata, int first_item, const char *folder,
bool (*cb_add_item)(void *userdata, int level, int item, const char *title, nsurl *url, bool folder))
{
+ nserror error;
struct ami_hotlist_ctx ctx;
-
+
ctx.level = 0;
ctx.item = first_item;
ctx.folder = folder;
ctx.in_menu = false;
ctx.userdata = userdata;
ctx.cb = cb_add_item;
-
- return hotlist_iterate(&ctx,
+ ctx.found = false;
+
+ error = hotlist_iterate(&ctx,
ami_hotlist_folder_enter_cb,
ami_hotlist_address_cb,
ami_hotlist_folder_leave_cb);
+
+ if((error == NSERROR_OK) && (ctx.found == false))
+ hotlist_add_folder(folder, false, 0);
+
+ return error;
}
-----------------------------------------------------------------------
Summary of changes:
amiga/hotlist.c | 18 ++++++++++++++----
1 files changed, 14 insertions(+), 4 deletions(-)
diff --git a/amiga/hotlist.c b/amiga/hotlist.c
index 70f0143..b67ba22 100755
--- a/amiga/hotlist.c
+++ b/amiga/hotlist.c
@@ -27,6 +27,7 @@ struct ami_hotlist_ctx {
int item;
const char *folder; /* folder we're interested in */
bool in_menu; /* set if we are in that folder */
+ bool found; /* set if the folder is found */
bool (*cb)(void *userdata, int level, int item, const char *title, nsurl *url, bool folder);
};
@@ -54,8 +55,10 @@ static nserror ami_hotlist_folder_enter_cb(void *ctx, const char *title)
if(menu_ctx->cb(menu_ctx->userdata, menu_ctx->level, menu_ctx->item, title, NULL, true) == true)
menu_ctx->item++;
} else {
- if((menu_ctx->level == 0) && (strcmp(title, menu_ctx->folder) == 0))
+ if((menu_ctx->level == 0) && (strcmp(title, menu_ctx->folder) == 0)) {
menu_ctx->in_menu = true;
+ menu_ctx->found = true;
+ }
}
menu_ctx->level++;
return NSERROR_OK;
@@ -88,17 +91,24 @@ static nserror ami_hotlist_folder_leave_cb(void *ctx)
nserror ami_hotlist_scan(void *userdata, int first_item, const char *folder,
bool (*cb_add_item)(void *userdata, int level, int item, const char *title, nsurl *url, bool folder))
{
+ nserror error;
struct ami_hotlist_ctx ctx;
-
+
ctx.level = 0;
ctx.item = first_item;
ctx.folder = folder;
ctx.in_menu = false;
ctx.userdata = userdata;
ctx.cb = cb_add_item;
-
- return hotlist_iterate(&ctx,
+ ctx.found = false;
+
+ error = hotlist_iterate(&ctx,
ami_hotlist_folder_enter_cb,
ami_hotlist_address_cb,
ami_hotlist_folder_leave_cb);
+
+ if((error == NSERROR_OK) && (ctx.found == false))
+ hotlist_add_folder(folder, false, 0);
+
+ return error;
}
--
NetSurf Browser
9 years, 3 months
netsurf: branch master updated. release/3.0-687-g5b02d2b
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/5b02d2b681398a5ba0eb8...
...commit http://git.netsurf-browser.org/netsurf.git/commit/5b02d2b681398a5ba0eb883...
...tree http://git.netsurf-browser.org/netsurf.git/tree/5b02d2b681398a5ba0eb8831f...
The branch, master has been updated
via 5b02d2b681398a5ba0eb8831f0829388e5be819b (commit)
from 77129038ee8aa8ccdf8f4a264fd1189459e69326 (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=5b02d2b681398a5ba0e...
commit 5b02d2b681398a5ba0eb8831f0829388e5be819b
Author: Ole Loots <ole(a)monochrom.net>
Commit: Ole Loots <ole(a)monochrom.net>
Set throbber background to be transparent, again.
diff --git a/atari/res/netsurf.rsc b/atari/res/netsurf.rsc
index 37cdcc2..b47cff0 100755
Binary files a/atari/res/netsurf.rsc and b/atari/res/netsurf.rsc differ
diff --git a/atari/res/netsurf.rsh b/atari/res/netsurf.rsh
index 54c88d6..7255544 100755
--- a/atari/res/netsurf.rsh
+++ b/atari/res/netsurf.rsh
@@ -58,7 +58,7 @@
#define TOOLBAR_BT_STOP 15 /* CICON in tree TOOLBAR */
#define TOOLBAR_BT_RELOAD 16 /* CICON in tree TOOLBAR */
#define TOOLBAR_AREA_URL 17 /* USERDEF in tree TOOLBAR */
-#define TOOLBAR_THROBBER_AREA 18 /* BOX in tree TOOLBAR */
+#define TOOLBAR_THROBBER_AREA 18 /* IBOX in tree TOOLBAR */
#define ICONIFY 2 /* form/dial */
#define ICONIFY_GLOBE 1 /* CICON in tree ICONIFY */
diff --git a/atari/res/netsurf.rsm b/atari/res/netsurf.rsm
index 75a7b46..37741a9 100755
--- a/atari/res/netsurf.rsm
+++ b/atari/res/netsurf.rsm
@@ -3,7 +3,7 @@ ResourceMaster v3.65
#N 99@32@AZAaza___ _@AZAaza090___ _@@_@
#FoC-Header@rsm2out@C-Header@rsh@@@[C-Header@0@
#R 0@0@1@1@2@1@
-#M 20010100@0@7728@652@
+#M 20010100@0@7728@653@
#T 0@1@MAINMENU@@64@@
#O 4@32@T_FILE@@
#O 5@32@T_EDIT@@
@@ -61,7 +61,7 @@ ResourceMaster v3.65
#O 15@33@BT_STOP@@
#O 16@33@BT_RELOAD@@
#O 17@24@AREA_URL@@
-#O 18@20@THROBBER_AREA@@
+#O 18@25@THROBBER_AREA@@
#T 2@2@ICONIFY@@3@@
#O 1@33@GLOBE@@
#T 3@2@FAVICON@@2@@
@@ -206,4 +206,4 @@ ResourceMaster v3.65
#T 17@2@TOOLBAR_HISTORY@@1@@
#T 18@2@TOOLBAR_SSL_CERT@@2@@
#O 1@26@TRUSTED@@
-#c 28820@
+#c 28824@
-----------------------------------------------------------------------
Summary of changes:
atari/res/netsurf.rsc | Bin 38082 -> 38082 bytes
atari/res/netsurf.rsh | 2 +-
atari/res/netsurf.rsm | 6 +++---
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/atari/res/netsurf.rsc b/atari/res/netsurf.rsc
index 37cdcc2..b47cff0 100755
Binary files a/atari/res/netsurf.rsc and b/atari/res/netsurf.rsc differ
diff --git a/atari/res/netsurf.rsh b/atari/res/netsurf.rsh
index 54c88d6..7255544 100755
--- a/atari/res/netsurf.rsh
+++ b/atari/res/netsurf.rsh
@@ -58,7 +58,7 @@
#define TOOLBAR_BT_STOP 15 /* CICON in tree TOOLBAR */
#define TOOLBAR_BT_RELOAD 16 /* CICON in tree TOOLBAR */
#define TOOLBAR_AREA_URL 17 /* USERDEF in tree TOOLBAR */
-#define TOOLBAR_THROBBER_AREA 18 /* BOX in tree TOOLBAR */
+#define TOOLBAR_THROBBER_AREA 18 /* IBOX in tree TOOLBAR */
#define ICONIFY 2 /* form/dial */
#define ICONIFY_GLOBE 1 /* CICON in tree ICONIFY */
diff --git a/atari/res/netsurf.rsm b/atari/res/netsurf.rsm
index 75a7b46..37741a9 100755
--- a/atari/res/netsurf.rsm
+++ b/atari/res/netsurf.rsm
@@ -3,7 +3,7 @@ ResourceMaster v3.65
#N 99@32@AZAaza___ _@AZAaza090___ _@@_@
#FoC-Header@rsm2out@C-Header@rsh@@@[C-Header@0@
#R 0@0@1@1@2@1@
-#M 20010100@0@7728@652@
+#M 20010100@0@7728@653@
#T 0@1@MAINMENU@@64@@
#O 4@32@T_FILE@@
#O 5@32@T_EDIT@@
@@ -61,7 +61,7 @@ ResourceMaster v3.65
#O 15@33@BT_STOP@@
#O 16@33@BT_RELOAD@@
#O 17@24@AREA_URL@@
-#O 18@20@THROBBER_AREA@@
+#O 18@25@THROBBER_AREA@@
#T 2@2@ICONIFY@@3@@
#O 1@33@GLOBE@@
#T 3@2@FAVICON@@2@@
@@ -206,4 +206,4 @@ ResourceMaster v3.65
#T 17@2@TOOLBAR_HISTORY@@1@@
#T 18@2@TOOLBAR_SSL_CERT@@2@@
#O 1@26@TRUSTED@@
-#c 28820@
+#c 28824@
--
NetSurf Browser
9 years, 3 months
netsurf: branch master updated. release/3.0-686-g7712903
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/77129038ee8aa8ccdf8f4...
...commit http://git.netsurf-browser.org/netsurf.git/commit/77129038ee8aa8ccdf8f4a2...
...tree http://git.netsurf-browser.org/netsurf.git/tree/77129038ee8aa8ccdf8f4a264...
The branch, master has been updated
via 77129038ee8aa8ccdf8f4a264fd1189459e69326 (commit)
from 164571aa98871d47f2efda842d75507f9bd03150 (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=77129038ee8aa8ccdf8...
commit 77129038ee8aa8ccdf8f4a264fd1189459e69326
Author: Ole Loots <ole(a)monochrom.net>
Commit: Ole Loots <ole(a)monochrom.net>
Handle the fact that / is NOT the root of the filesystem on MiNT.
(/ means current drive!) This may break under Classic TOS
versions, because it may rely on the U: drive. However,
that can be fixed later on.
diff --git a/atari/findfile.c b/atari/findfile.c
index d4c4c30..61dc3a2 100755
--- a/atari/findfile.c
+++ b/atari/findfile.c
@@ -37,6 +37,9 @@ char * local_file_to_url( const char * filename )
{
#define BACKSLASH 0x5C
char * url;
+
+ LOG(("in: %s", filename));
+
if( strlen(filename) <= 2){
return( NULL );
}
@@ -45,22 +48,6 @@ char * local_file_to_url( const char * filename )
char * start = (char*)fname_local;
strcpy( start, filename );
- /* if path points to unified filesystem, skip that info: */
- if( fname_local[1] == ':' && fname_local[0] == 'U' ){
- start = &fname_local[2];
- }
-
- /* if we got something like "C:\folder\file.txt", handle that: */
- if( start[1] == ':' ){
- start[1] = (char)tolower(start[0]);
- start++;
- }
-
- /* skip leading slash, already included in file scheme: */
- if( start[0] == (char)BACKSLASH || start[0] == '/' ){
- start++;
- }
-
/* convert backslashes: */
for( unsigned int i=0; i<strlen(start); i++ ){
if( start[i] == BACKSLASH ){
@@ -70,11 +57,13 @@ char * local_file_to_url( const char * filename )
// TODO: make file path absolute if it isn't yet.
url = malloc( strlen(start) + FILE_SCHEME_PREFIX_LEN + 1);
- strcpy( url, FILE_SCHEME_PREFIX );
- strcat( url, start );
+ strcpy(url, FILE_SCHEME_PREFIX );
+ strcat(url, start );
free(fname_local);
+ LOG(("out: %s", url));
+
return( url );
#undef BACKSLASH
}
@@ -83,27 +72,11 @@ char * local_file_to_url( const char * filename )
char *path_to_url(const char *path_in)
{
#define BACKSLASH 0x5C
- char * path_ptr=NULL;
char * path;
- LOG(("path2url in: %s\n", path_in));
- if (*path_in == '/') {
- path_in++; /* file: path is are already absolute */
- path = (char*)path_in;
- } else {
- path = path_ptr = (char*)malloc(PATH_MAX+1);
- gemdos_realpath(path_in, path);
+ LOG(("path2url in: %s\n", path_in));
- if( *path == '/' || *path == BACKSLASH ) {
- path++;
- }
- if( sys_type() != SYS_MINT ){
- if( path[1] == ':' ) {
- path[1] = path[0];
- path++;
- }
- }
- }
+ path = (char*)path_in;
int urllen = strlen(path) + FILE_SCHEME_PREFIX_LEN + 1;
char *url = malloc(urllen);
@@ -117,8 +90,7 @@ char *path_to_url(const char *path_in)
}
i++;
}
- if( path_ptr )
- free( path_ptr );
+
LOG(("path2url out: %s\n", url));
return url;
#undef BACKSLASH
@@ -130,21 +102,22 @@ char *url_to_path(const char *url)
char *url_path = curl_unescape(url, 0);
char *path;
char abspath[PATH_MAX+1];
- LOG(( "url2path in: %s\n", url ));
- /* printf( "url2path in: %s\n", url_path ); */
- /* return the absolute path including leading / */
- /* todo: better check for filesystem? */
- if( sys_type() & SYS_MINT ) {
- /* it's ok to have relative paths with mint, just strip proto: */
- path = strdup(url_path + (FILE_SCHEME_PREFIX_LEN -1));
+
+ LOG(( "url2path in: %s (%s)\n", url, url_path ));
+
+ // is the URL relative?
+ if (url_path[7] == '.') {
+ // yes, make it absolute...
+ gemdos_realpath(url_path + (FILE_SCHEME_PREFIX_LEN-1), abspath);
+ path = strdup(abspath);
} else {
- /* do not include / within url_path */
- char * tmp = url_path + (FILE_SCHEME_PREFIX_LEN-1);
- gemdos_realpath( tmp, (char*)&abspath );
- path = strdup( (char*)&abspath );
+ path = strdup(url_path + (FILE_SCHEME_PREFIX_LEN));
}
+
curl_free(url_path);
+
LOG(( "url2path out: %s\n", path ));
+
return path;
}
diff --git a/atari/osspec.c b/atari/osspec.c
index ada1e05..5bd7320 100644
--- a/atari/osspec.c
+++ b/atari/osspec.c
@@ -22,7 +22,8 @@
#include <unistd.h>
#include <stdbool.h>
#include <stdio.h>
-#include <string.h>
+#include <string.h>
+#include <support.h>
#include <mint/osbind.h>
#include <mint/cookie.h>
@@ -96,86 +97,38 @@ int tos_getcookie(long tag, long * value)
}
/*
+
a fixed version of realpath() which returns valid
- paths for TOS which have no root fs. (/ , U: )
+ paths for TOS which have no U: drive
+
*/
char * gemdos_realpath(const char * path, char * rpath)
{
char work[PATH_MAX+1];
- char * work_ptr;
- size_t l;
-
- if( rpath == NULL ){
- return( NULL );
- }
- if( sys_type() & SYS_MINT ){
- return( realpath(path, rpath) );
- }
-
- LOG(("gdos rpath in: %s\n", path));
- memset( rpath, 0, PATH_MAX );
-
- /* first, absolutize relative path: */
- if( *path == '.' ){
- char cwd[PATH_MAX+1];
- getcwd((char*)&cwd, PATH_MAX);
- l = strlen( cwd );
- if( cwd[l-1] != 0x5C && cwd[l-1] != '/' ){
- cwd[l] = 0x5C;
- cwd[l+1] = 0;
- l++;
- }
-
- strncpy( (char*)&work, cwd, PATH_MAX );
-
- /* check for path, or maybe just a file name? */
- if( strlen(path) > 2 ) {
- int off = 0;
- if( path[1] == '/' || path[1] == 0x5C ){
- off = 2;
- }
- strncat( (char*)&work, (char*)(path+off), PATH_MAX-l );
- }
- work_ptr = (char*)&work;
- } else {
- work_ptr = (char*)path;
- }
-
- /* handle invalid cwd path */
- /* mintlib produces these on plain TOS systems: */
- if( strncmp( (char*)work_ptr, "/dev/", 5) == 0 ){
- work_ptr += 4;
- }
-
- /* make TOS compatible path, step 1: */
- l = strlen( work_ptr);
- if( l > 1 ){
- if( *work_ptr == '/' || *work_ptr == 0x5C ){
- rpath[0] = work_ptr[1];
- rpath[1] = ':';
- strncat( rpath, &work_ptr[2], PATH_MAX-2 );
- } else {
- strncpy( rpath, work_ptr, PATH_MAX );
- }
-
- /* step 2, perform seperator conversion: */
- l = strlen( rpath );
- rpath[PATH_MAX-1]=0;
- work_ptr = rpath;
- do{
- if( *work_ptr == '/' )
- *work_ptr = 0x5C;
- work_ptr++;
- } while( *work_ptr != 0 );
-
- if( rpath[l-1] == 0x5C || rpath[l-1] == '/' )
- rpath[l-1] = 0;
- } else {
- strncpy( rpath, work_ptr, PATH_MAX );
+ char * r;
+
+
+ if (rpath == NULL) {
+ return (NULL);
+ }
+
+ // Check if the path is already absolute:
+ if(path[1] == ':'){
+ strcpy(rpath, path);
+ return(rpath);
}
- l = strlen( rpath );
- LOG(("gdos rpath out: %s\n", rpath));
- return( rpath );
+
+ LOG(("realpath in: %s\n", path));
+ r = realpath(path, work);
+ if (r != NULL) {
+ int e = unx2dos((const char *)r, rpath);
+ LOG(("realpath out: %s\n", rpath));
+ return(rpath);
+ }
+ else {
+ LOG(("realpath out: NULL!\n"));
+ }
+ return (NULL);
}
-----------------------------------------------------------------------
Summary of changes:
atari/findfile.c | 71 +++++++++++-------------------------
atari/osspec.c | 103 +++++++++++++++---------------------------------------
2 files changed, 50 insertions(+), 124 deletions(-)
diff --git a/atari/findfile.c b/atari/findfile.c
index d4c4c30..61dc3a2 100755
--- a/atari/findfile.c
+++ b/atari/findfile.c
@@ -37,6 +37,9 @@ char * local_file_to_url( const char * filename )
{
#define BACKSLASH 0x5C
char * url;
+
+ LOG(("in: %s", filename));
+
if( strlen(filename) <= 2){
return( NULL );
}
@@ -45,22 +48,6 @@ char * local_file_to_url( const char * filename )
char * start = (char*)fname_local;
strcpy( start, filename );
- /* if path points to unified filesystem, skip that info: */
- if( fname_local[1] == ':' && fname_local[0] == 'U' ){
- start = &fname_local[2];
- }
-
- /* if we got something like "C:\folder\file.txt", handle that: */
- if( start[1] == ':' ){
- start[1] = (char)tolower(start[0]);
- start++;
- }
-
- /* skip leading slash, already included in file scheme: */
- if( start[0] == (char)BACKSLASH || start[0] == '/' ){
- start++;
- }
-
/* convert backslashes: */
for( unsigned int i=0; i<strlen(start); i++ ){
if( start[i] == BACKSLASH ){
@@ -70,11 +57,13 @@ char * local_file_to_url( const char * filename )
// TODO: make file path absolute if it isn't yet.
url = malloc( strlen(start) + FILE_SCHEME_PREFIX_LEN + 1);
- strcpy( url, FILE_SCHEME_PREFIX );
- strcat( url, start );
+ strcpy(url, FILE_SCHEME_PREFIX );
+ strcat(url, start );
free(fname_local);
+ LOG(("out: %s", url));
+
return( url );
#undef BACKSLASH
}
@@ -83,27 +72,11 @@ char * local_file_to_url( const char * filename )
char *path_to_url(const char *path_in)
{
#define BACKSLASH 0x5C
- char * path_ptr=NULL;
char * path;
- LOG(("path2url in: %s\n", path_in));
- if (*path_in == '/') {
- path_in++; /* file: path is are already absolute */
- path = (char*)path_in;
- } else {
- path = path_ptr = (char*)malloc(PATH_MAX+1);
- gemdos_realpath(path_in, path);
+ LOG(("path2url in: %s\n", path_in));
- if( *path == '/' || *path == BACKSLASH ) {
- path++;
- }
- if( sys_type() != SYS_MINT ){
- if( path[1] == ':' ) {
- path[1] = path[0];
- path++;
- }
- }
- }
+ path = (char*)path_in;
int urllen = strlen(path) + FILE_SCHEME_PREFIX_LEN + 1;
char *url = malloc(urllen);
@@ -117,8 +90,7 @@ char *path_to_url(const char *path_in)
}
i++;
}
- if( path_ptr )
- free( path_ptr );
+
LOG(("path2url out: %s\n", url));
return url;
#undef BACKSLASH
@@ -130,21 +102,22 @@ char *url_to_path(const char *url)
char *url_path = curl_unescape(url, 0);
char *path;
char abspath[PATH_MAX+1];
- LOG(( "url2path in: %s\n", url ));
- /* printf( "url2path in: %s\n", url_path ); */
- /* return the absolute path including leading / */
- /* todo: better check for filesystem? */
- if( sys_type() & SYS_MINT ) {
- /* it's ok to have relative paths with mint, just strip proto: */
- path = strdup(url_path + (FILE_SCHEME_PREFIX_LEN -1));
+
+ LOG(( "url2path in: %s (%s)\n", url, url_path ));
+
+ // is the URL relative?
+ if (url_path[7] == '.') {
+ // yes, make it absolute...
+ gemdos_realpath(url_path + (FILE_SCHEME_PREFIX_LEN-1), abspath);
+ path = strdup(abspath);
} else {
- /* do not include / within url_path */
- char * tmp = url_path + (FILE_SCHEME_PREFIX_LEN-1);
- gemdos_realpath( tmp, (char*)&abspath );
- path = strdup( (char*)&abspath );
+ path = strdup(url_path + (FILE_SCHEME_PREFIX_LEN));
}
+
curl_free(url_path);
+
LOG(( "url2path out: %s\n", path ));
+
return path;
}
diff --git a/atari/osspec.c b/atari/osspec.c
index ada1e05..5bd7320 100644
--- a/atari/osspec.c
+++ b/atari/osspec.c
@@ -22,7 +22,8 @@
#include <unistd.h>
#include <stdbool.h>
#include <stdio.h>
-#include <string.h>
+#include <string.h>
+#include <support.h>
#include <mint/osbind.h>
#include <mint/cookie.h>
@@ -96,86 +97,38 @@ int tos_getcookie(long tag, long * value)
}
/*
+
a fixed version of realpath() which returns valid
- paths for TOS which have no root fs. (/ , U: )
+ paths for TOS which have no U: drive
+
*/
char * gemdos_realpath(const char * path, char * rpath)
{
char work[PATH_MAX+1];
- char * work_ptr;
- size_t l;
-
- if( rpath == NULL ){
- return( NULL );
- }
- if( sys_type() & SYS_MINT ){
- return( realpath(path, rpath) );
- }
-
- LOG(("gdos rpath in: %s\n", path));
- memset( rpath, 0, PATH_MAX );
-
- /* first, absolutize relative path: */
- if( *path == '.' ){
- char cwd[PATH_MAX+1];
- getcwd((char*)&cwd, PATH_MAX);
- l = strlen( cwd );
- if( cwd[l-1] != 0x5C && cwd[l-1] != '/' ){
- cwd[l] = 0x5C;
- cwd[l+1] = 0;
- l++;
- }
-
- strncpy( (char*)&work, cwd, PATH_MAX );
-
- /* check for path, or maybe just a file name? */
- if( strlen(path) > 2 ) {
- int off = 0;
- if( path[1] == '/' || path[1] == 0x5C ){
- off = 2;
- }
- strncat( (char*)&work, (char*)(path+off), PATH_MAX-l );
- }
- work_ptr = (char*)&work;
- } else {
- work_ptr = (char*)path;
- }
-
- /* handle invalid cwd path */
- /* mintlib produces these on plain TOS systems: */
- if( strncmp( (char*)work_ptr, "/dev/", 5) == 0 ){
- work_ptr += 4;
- }
-
- /* make TOS compatible path, step 1: */
- l = strlen( work_ptr);
- if( l > 1 ){
- if( *work_ptr == '/' || *work_ptr == 0x5C ){
- rpath[0] = work_ptr[1];
- rpath[1] = ':';
- strncat( rpath, &work_ptr[2], PATH_MAX-2 );
- } else {
- strncpy( rpath, work_ptr, PATH_MAX );
- }
-
- /* step 2, perform seperator conversion: */
- l = strlen( rpath );
- rpath[PATH_MAX-1]=0;
- work_ptr = rpath;
- do{
- if( *work_ptr == '/' )
- *work_ptr = 0x5C;
- work_ptr++;
- } while( *work_ptr != 0 );
-
- if( rpath[l-1] == 0x5C || rpath[l-1] == '/' )
- rpath[l-1] = 0;
- } else {
- strncpy( rpath, work_ptr, PATH_MAX );
+ char * r;
+
+
+ if (rpath == NULL) {
+ return (NULL);
+ }
+
+ // Check if the path is already absolute:
+ if(path[1] == ':'){
+ strcpy(rpath, path);
+ return(rpath);
}
- l = strlen( rpath );
- LOG(("gdos rpath out: %s\n", rpath));
- return( rpath );
+
+ LOG(("realpath in: %s\n", path));
+ r = realpath(path, work);
+ if (r != NULL) {
+ int e = unx2dos((const char *)r, rpath);
+ LOG(("realpath out: %s\n", rpath));
+ return(rpath);
+ }
+ else {
+ LOG(("realpath out: NULL!\n"));
+ }
+ return (NULL);
}
--
NetSurf Browser
9 years, 3 months
netsurf: branch master updated. release/3.0-685-g164571a
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/164571aa98871d47f2efd...
...commit http://git.netsurf-browser.org/netsurf.git/commit/164571aa98871d47f2efda8...
...tree http://git.netsurf-browser.org/netsurf.git/tree/164571aa98871d47f2efda842...
The branch, master has been updated
via 164571aa98871d47f2efda842d75507f9bd03150 (commit)
from 3fc666a9be6bd9c8b15616c60f332e1427a90f1d (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=164571aa98871d47f2e...
commit 164571aa98871d47f2efda842d75507f9bd03150
Author: Ole Loots <ole(a)monochrom.net>
Commit: Ole Loots <ole(a)monochrom.net>
Translate NK_UNDO to KEY_UNDO.
diff --git a/atari/misc.c b/atari/misc.c
index 2893bde..90a8bee 100755
--- a/atari/misc.c
+++ b/atari/misc.c
@@ -449,6 +449,10 @@ long nkc_to_input_key(short nkc, long * ucs4_out)
case NK_UP:
ik = KEY_UP;
+ break;
+
+ case NK_UNDO:
+ ik = KEY_UNDO;
break;
case NK_DOWN:
-----------------------------------------------------------------------
Summary of changes:
atari/misc.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/atari/misc.c b/atari/misc.c
index 2893bde..90a8bee 100755
--- a/atari/misc.c
+++ b/atari/misc.c
@@ -449,6 +449,10 @@ long nkc_to_input_key(short nkc, long * ucs4_out)
case NK_UP:
ik = KEY_UP;
+ break;
+
+ case NK_UNDO:
+ ik = KEY_UNDO;
break;
case NK_DOWN:
--
NetSurf Browser
9 years, 3 months
netsurf: branch master updated. release/3.0-684-g3fc666a
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/3fc666a9be6bd9c8b1561...
...commit http://git.netsurf-browser.org/netsurf.git/commit/3fc666a9be6bd9c8b15616c...
...tree http://git.netsurf-browser.org/netsurf.git/tree/3fc666a9be6bd9c8b15616c60...
The branch, master has been updated
via 3fc666a9be6bd9c8b15616c60f332e1427a90f1d (commit)
from 4776f05430e1b8002e6ca6eec3e69f84fa130eda (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=3fc666a9be6bd9c8b15...
commit 3fc666a9be6bd9c8b15616c60f332e1427a90f1d
Author: Michael Drake <tlsa(a)netsurf-browser.org>
Commit: Michael Drake <tlsa(a)netsurf-browser.org>
Squash Coverity #1109879 - Resource leak.
diff --git a/render/box_construct.c b/render/box_construct.c
index cc30d89..3251cc1 100644
--- a/render/box_construct.c
+++ b/render/box_construct.c
@@ -2118,12 +2118,16 @@ bool box_create_frameset(struct content_html_frames *f, dom_node *n,
if (err == DOM_NO_ERR && s != NULL) {
col_width = box_parse_multi_lengths(dom_string_data(s), &cols);
dom_string_unref(s);
- if (col_width == NULL)
+ if (col_width == NULL) {
+ free(row_height);
return false;
+ }
} else {
col_width = calloc(1, sizeof(struct frame_dimension));
- if (col_width == NULL)
+ if (col_width == NULL) {
+ free(row_height);
return false;
+ }
col_width->value = 100;
col_width->unit = FRAME_DIMENSION_PERCENT;
}
-----------------------------------------------------------------------
Summary of changes:
render/box_construct.c | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/render/box_construct.c b/render/box_construct.c
index cc30d89..3251cc1 100644
--- a/render/box_construct.c
+++ b/render/box_construct.c
@@ -2118,12 +2118,16 @@ bool box_create_frameset(struct content_html_frames *f, dom_node *n,
if (err == DOM_NO_ERR && s != NULL) {
col_width = box_parse_multi_lengths(dom_string_data(s), &cols);
dom_string_unref(s);
- if (col_width == NULL)
+ if (col_width == NULL) {
+ free(row_height);
return false;
+ }
} else {
col_width = calloc(1, sizeof(struct frame_dimension));
- if (col_width == NULL)
+ if (col_width == NULL) {
+ free(row_height);
return false;
+ }
col_width->value = 100;
col_width->unit = FRAME_DIMENSION_PERCENT;
}
--
NetSurf Browser
9 years, 3 months
netsurf: branch master updated. release/3.0-683-g4776f05
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/4776f05430e1b8002e6ca...
...commit http://git.netsurf-browser.org/netsurf.git/commit/4776f05430e1b8002e6ca6e...
...tree http://git.netsurf-browser.org/netsurf.git/tree/4776f05430e1b8002e6ca6eec...
The branch, master has been updated
via 4776f05430e1b8002e6ca6eec3e69f84fa130eda (commit)
from 6b29a697b9879c03146cca24bb30c64d25810cb8 (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=4776f05430e1b8002e6...
commit 4776f05430e1b8002e6ca6eec3e69f84fa130eda
Author: Vincent Sanders <vince(a)netsurf-browser.org>
Commit: Vincent Sanders <vince(a)netsurf-browser.org>
fix potential division by zero by only computing width and height when content is valid and hence will return content width and height not zero. coverity 110986[23]
diff --git a/render/html_object.c b/render/html_object.c
index f7ed3bd..e66667b 100644
--- a/render/html_object.c
+++ b/render/html_object.c
@@ -293,10 +293,12 @@ html_object_callback(hlcache_handle *object,
} else {
/* Non-background case */
- int w = content_get_width(object);
- int h = content_get_height(object);
if (hlcache_handle_get_content(object) ==
event->data.redraw.object) {
+
+ int w = content_get_width(object);
+ int h = content_get_height(object);
+
data.redraw.x = data.redraw.x *
box->width / w;
data.redraw.y = data.redraw.y *
-----------------------------------------------------------------------
Summary of changes:
render/html_object.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/render/html_object.c b/render/html_object.c
index f7ed3bd..e66667b 100644
--- a/render/html_object.c
+++ b/render/html_object.c
@@ -293,10 +293,12 @@ html_object_callback(hlcache_handle *object,
} else {
/* Non-background case */
- int w = content_get_width(object);
- int h = content_get_height(object);
if (hlcache_handle_get_content(object) ==
event->data.redraw.object) {
+
+ int w = content_get_width(object);
+ int h = content_get_height(object);
+
data.redraw.x = data.redraw.x *
box->width / w;
data.redraw.y = data.redraw.y *
--
NetSurf Browser
9 years, 3 months