mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-12-22 12:12:35 +03:00
Content interface to get at contextual content at point.
svn path=/trunk/netsurf/; revision=12753
This commit is contained in:
parent
318803d382
commit
4075648e7a
@ -701,6 +701,22 @@ struct selection *content_get_selection(hlcache_handle *h)
|
||||
}
|
||||
|
||||
|
||||
void content_get_contextual_content(struct hlcache_handle *h,
|
||||
int x, int y, struct contextual_content *data)
|
||||
{
|
||||
struct content *c = hlcache_handle_get_content(h);
|
||||
assert(c != 0);
|
||||
|
||||
if (c->handler->get_contextual_content != NULL) {
|
||||
c->handler->get_contextual_content(c, x, y, data);
|
||||
return;
|
||||
} else {
|
||||
data->object = h;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void content_add_error(struct content *c, const char *token,
|
||||
unsigned int line)
|
||||
{
|
||||
|
@ -158,6 +158,8 @@ void content_open(struct hlcache_handle *h, struct browser_window *bw,
|
||||
struct object_params *params);
|
||||
void content_close(struct hlcache_handle *h);
|
||||
struct selection *content_get_selection(struct hlcache_handle *h);
|
||||
void content_get_contextual_content(struct hlcache_handle *h,
|
||||
int x, int y, struct contextual_content *data);
|
||||
|
||||
/* Member accessors */
|
||||
content_type content_get_type(struct hlcache_handle *c);
|
||||
|
@ -65,6 +65,8 @@ struct content_handler {
|
||||
struct object_params *params);
|
||||
void (*close)(struct content *c);
|
||||
struct selection * (*get_selection)(struct content *c);
|
||||
void (*get_contextual_content)(struct content *c, int x, int y,
|
||||
struct contextual_content *data);
|
||||
nserror (*clone)(const struct content *old, struct content **newc);
|
||||
bool (*matches_quirks)(const struct content *c, bool quirks);
|
||||
content_type (*type)(void);
|
||||
|
@ -24,6 +24,7 @@
|
||||
#define _NETSURF_UTILS_TYPES_H_
|
||||
|
||||
struct plotter_table;
|
||||
struct hlcache_handle;
|
||||
|
||||
/* Rectangle coordinates */
|
||||
struct rect {
|
||||
@ -42,4 +43,12 @@ struct redraw_context {
|
||||
const struct plotter_table *plot;
|
||||
};
|
||||
|
||||
|
||||
/* Content located at a specific spatial location */
|
||||
struct contextual_content {
|
||||
const char *link_url;
|
||||
struct hlcache_handle *object;
|
||||
struct hlcache_handle *main;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user