mirror of
https://github.com/rkd77/elinks.git
synced 2024-09-30 03:26:23 -04:00
[iframes] Draw frame around iframe.
This commit is contained in:
parent
7a5adbc328
commit
9bf5494d10
@ -48,6 +48,7 @@ void add_iframeset_entry(struct iframeset_desc **parent,
|
|||||||
iframe_desc = &iframeset_desc->iframe_desc[offset];
|
iframe_desc = &iframeset_desc->iframe_desc[offset];
|
||||||
iframe_desc->name = stracpy(name);
|
iframe_desc->name = stracpy(name);
|
||||||
iframe_desc->uri = get_uri(url, 0);
|
iframe_desc->uri = get_uri(url, 0);
|
||||||
|
iframe_desc->x = 1;
|
||||||
iframe_desc->y = y;
|
iframe_desc->y = y;
|
||||||
iframe_desc->width = width;
|
iframe_desc->width = width;
|
||||||
iframe_desc->height = height;
|
iframe_desc->height = height;
|
||||||
@ -203,7 +204,7 @@ format_iframes(struct session *ses, struct iframeset_desc *ifsd,
|
|||||||
struct iframe_desc *iframe_desc = &ifsd->iframe_desc[j];
|
struct iframe_desc *iframe_desc = &ifsd->iframe_desc[j];
|
||||||
struct document_view *doc_view;
|
struct document_view *doc_view;
|
||||||
|
|
||||||
o.box.x = op->box.x;
|
o.box.x = iframe_desc->x;
|
||||||
o.box.y = iframe_desc->y;
|
o.box.y = iframe_desc->y;
|
||||||
|
|
||||||
o.box.width = iframe_desc->width;
|
o.box.width = iframe_desc->width;
|
||||||
|
@ -13,6 +13,7 @@ struct iframe_desc {
|
|||||||
char *name;
|
char *name;
|
||||||
struct uri *uri;
|
struct uri *uri;
|
||||||
|
|
||||||
|
int x;
|
||||||
int y;
|
int y;
|
||||||
int width, height;
|
int width, height;
|
||||||
};
|
};
|
||||||
|
@ -503,9 +503,9 @@ html_iframe_do(char *a, char *object_src,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (height > 0) {
|
if (height > 0) {
|
||||||
int y = html_context->part->cy;
|
int y = html_context->part->cy + 1;
|
||||||
char *url2;
|
char *url2;
|
||||||
ln_break(html_context, height + 1);
|
ln_break(html_context, height + 3);
|
||||||
|
|
||||||
url2 = join_urls(html_context->base_href, url);
|
url2 = join_urls(html_context->base_href, url);
|
||||||
|
|
||||||
|
@ -17,6 +17,7 @@
|
|||||||
#include "cache/cache.h"
|
#include "cache/cache.h"
|
||||||
#include "document/document.h"
|
#include "document/document.h"
|
||||||
#include "document/html/frames.h"
|
#include "document/html/frames.h"
|
||||||
|
#include "document/html/iframes.h"
|
||||||
#include "document/options.h"
|
#include "document/options.h"
|
||||||
#include "document/refresh.h"
|
#include "document/refresh.h"
|
||||||
#include "document/renderer.h"
|
#include "document/renderer.h"
|
||||||
@ -165,6 +166,46 @@ draw_frame_lines(struct terminal *term, struct frameset_desc *frameset_desc,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
draw_iframe_lines(struct terminal *term, struct iframeset_desc *iframe_desc,
|
||||||
|
int xp, int yp, struct color_pair *colors)
|
||||||
|
{
|
||||||
|
int j;
|
||||||
|
|
||||||
|
assert(term && iframe_desc && iframe_desc->iframe_desc);
|
||||||
|
if_assert_failed return;
|
||||||
|
|
||||||
|
for (j = 0; j < iframe_desc->n; j++) {
|
||||||
|
struct el_box box;
|
||||||
|
|
||||||
|
int y = iframe_desc->iframe_desc[j].y - 1;
|
||||||
|
int x = iframe_desc->iframe_desc[j].x - 1;
|
||||||
|
|
||||||
|
int height = iframe_desc->iframe_desc[j].height + 1;
|
||||||
|
int width = iframe_desc->iframe_desc[j].width + 1;
|
||||||
|
|
||||||
|
set_box(&box, x, y + 1, 1, height - 1);
|
||||||
|
draw_box(term, &box, BORDER_SVLINE, SCREEN_ATTR_FRAME, colors);
|
||||||
|
|
||||||
|
set_box(&box, x + width, y + 1, 1, height - 1);
|
||||||
|
draw_box(term, &box, BORDER_SVLINE, SCREEN_ATTR_FRAME, colors);
|
||||||
|
|
||||||
|
set_box(&box, x + 1, y, width -1 , 1);
|
||||||
|
draw_box(term, &box, BORDER_SHLINE, SCREEN_ATTR_FRAME, colors);
|
||||||
|
|
||||||
|
set_box(&box, x + 1, y + height, width - 1, 1);
|
||||||
|
draw_box(term, &box, BORDER_SHLINE, SCREEN_ATTR_FRAME, colors);
|
||||||
|
|
||||||
|
draw_border_char(term, x, y, BORDER_SULCORNER, colors);
|
||||||
|
draw_border_char(term, x, y + height, BORDER_SDLCORNER, colors);
|
||||||
|
|
||||||
|
draw_border_char(term, x + width, y, BORDER_SURCORNER, colors);
|
||||||
|
draw_border_char(term, x + width, y + height, BORDER_SDRCORNER, colors);
|
||||||
|
draw_border_cross(term, x, y, BORDER_X_DOWN, colors);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
draw_clipboard(struct terminal *term, struct document_view *doc_view)
|
draw_clipboard(struct terminal *term, struct document_view *doc_view)
|
||||||
{
|
{
|
||||||
@ -295,6 +336,7 @@ draw_doc(struct session *ses, struct document_view *doc_view, int active)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (ses->navigate_mode == NAVIGATE_LINKWISE) {
|
if (ses->navigate_mode == NAVIGATE_LINKWISE) {
|
||||||
check_vs(doc_view);
|
check_vs(doc_view);
|
||||||
} else {
|
} else {
|
||||||
@ -362,6 +404,12 @@ draw_doc(struct session *ses, struct document_view *doc_view, int active)
|
|||||||
draw_view_status(ses, doc_view, active);
|
draw_view_status(ses, doc_view, active);
|
||||||
if (has_search_word(doc_view))
|
if (has_search_word(doc_view))
|
||||||
doc_view->last_x = doc_view->last_y = -1;
|
doc_view->last_x = doc_view->last_y = -1;
|
||||||
|
|
||||||
|
if (document_has_iframes(doc_view->document)) {
|
||||||
|
draw_iframe_lines(term, doc_view->document->iframe_desc, box->x, box->y, &color);
|
||||||
|
if (vs->current_link == -1)
|
||||||
|
vs->current_link = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
Loading…
Reference in New Issue
Block a user