NetSurf
Data Structures | Functions
content.h File Reference

Public content interface. More...

#include <libwapcaplet/libwapcaplet.h>
#include "netsurf/types.h"
#include "netsurf/content_type.h"
Include dependency graph for content.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  content_redraw_data
 parameters to content redraw More...
 

Functions

struct bitmapcontent_get_bitmap (struct hlcache_handle *h)
 Retrieve the bitmap contained in an image content. More...
 
const char * content_get_encoding (struct hlcache_handle *h, enum content_encoding_type op)
 Retrieve the encoding of a content. More...
 
lwc_string * content_get_mime_type (struct hlcache_handle *h)
 Retrieve mime-type of content. More...
 
const uint8_t * content_get_source_data (struct hlcache_handle *h, size_t *size)
 Retrieve source of content. More...
 
const char * content_get_title (struct hlcache_handle *h)
 Retrieve title associated with content. More...
 
content_type content_get_type (struct hlcache_handle *h)
 Retrieve computed type of content. More...
 
int content_get_width (struct hlcache_handle *h)
 Retrieve width of content. More...
 
int content_get_height (struct hlcache_handle *h)
 Retrieve height of content. More...
 
void content_invalidate_reuse_data (struct hlcache_handle *h)
 Invalidate content reuse data. More...
 
bool content_redraw (struct hlcache_handle *h, struct content_redraw_data *data, const struct rect *clip, const struct redraw_context *ctx)
 Display content on screen with optional tiling. More...
 
bool content_scaled_redraw (struct hlcache_handle *h, int width, int height, const struct redraw_context *ctx)
 Redraw a content with scale set for horizontal fit. More...
 
struct nsurlhlcache_handle_get_url (const struct hlcache_handle *handle)
 Retrieve the URL associated with a high level cache handle. More...
 

Detailed Description

Public content interface.

The content functions manipulate content objects.

Definition in file content.h.

Function Documentation

◆ content_get_bitmap()

struct bitmap * content_get_bitmap ( struct hlcache_handle h)

Retrieve the bitmap contained in an image content.

Parameters
hhandle to the content.
Returns
Pointer to bitmap, or NULL if none.

Definition at line 1264 of file content.c.

References content__get_bitmap(), and hlcache_handle_get_content().

Referenced by ami_file_save(), ami_gui_menu_update_disabled(), ami_gui_update_hotlist_button(), amiga_icon_superimpose_favicon_internal(), browser_window_history_get_thumbnail(), default_ico_callback(), gui_window_set_icon(), HOOKF(), ro_gui_save_object_native(), search_web_get_provider_bitmap(), search_web_ico_callback(), and search_web_select_provider().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ content_get_encoding()

const char * content_get_encoding ( struct hlcache_handle h,
enum content_encoding_type  op 
)

Retrieve the encoding of a content.

Parameters
hhandle to the content.
opencoding operation.
Returns
Pointer to content info or NULL if none.

Definition at line 1321 of file content.c.

References content__get_encoding(), and hlcache_handle_get_content().

Referenced by browser_window_navigate(), nsgtk_viewsource(), and ro_gui_window_prepare_pageinfo().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ content_get_height()

int content_get_height ( struct hlcache_handle h)

Retrieve height of content.

Parameters
hhandle to the content to get height of.
Returns
Content height

Definition at line 1175 of file content.c.

References content__get_height(), and hlcache_handle_get_content().

Referenced by browser_window_content_done(), browser_window_get_extents(), browser_window_handle_scrollbars(), browser_window_history_update(), browser_window_redraw(), html_object_callback(), html_redraw_background(), html_redraw_inline_background(), layout_calculate_descendant_bboxes(), layout_get_object_dimensions(), layout_line(), layout_lists(), print_apply_settings(), print_basic_run(), print_declare_fonts(), print_document(), print_set_up(), ro_gui_url_bar_res_cb(), ro_gui_url_bar_set_site_favicon(), and treeview_res_cb().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ content_get_mime_type()

lwc_string * content_get_mime_type ( struct hlcache_handle h)

Retrieve mime-type of content.

Parameters
hhandle to the content to retrieve mime type from
Returns
Pointer to referenced mime type, or NULL if not found.

Definition at line 1073 of file content.c.

References content__get_mime_type(), and hlcache_handle_get_content().

Referenced by ami_mime_compare(), ami_mime_content_to_cmd(), ami_mime_content_to_filetype(), nsbeos_gui_view_source(), ro_content_filetype(), ro_gui_window_prepare_objectinfo(), ro_gui_window_prepare_pageinfo(), save_complete_save_html_document(), save_complete_save_html_object(), and save_complete_save_stylesheet().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ content_get_source_data()

const uint8_t * content_get_source_data ( struct hlcache_handle h,
size_t *  size 
)

Retrieve source of content.

Parameters
hContent handle to retrieve source of
sizePointer to location to receive byte size of source
Returns
Pointer to source data

Definition at line 1209 of file content.c.

References content__get_source_data(), hlcache_handle_get_content(), and content::size.

Referenced by ami_file_save(), context_popup(), convert_script_sync_cb(), html_script_exec(), nsbeos_gui_view_source(), nsgtk_viewsource(), ro_gui_save_content(), ro_gui_save_object_native(), ro_gui_theme_install_apply(), ro_gui_view_source(), RXHOOKF(), save_complete_save_html_object(), save_complete_save_stylesheet(), and theme_install_callback().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ content_get_title()

const char * content_get_title ( struct hlcache_handle h)

Retrieve title associated with content.

Parameters
hhandle to the content to retrieve title from
Returns
Pointer to title, or NULL if not found.

Definition at line 1106 of file content.c.

References content__get_title(), and hlcache_handle_get_content().

Referenced by ami_file_save(), browser_window_content_ready(), browser_window_get_title(), browser_window_history_add(), browser_window_history_update(), browser_window_update(), print_send_printsave(), ro_gui_save_complete(), ro_gui_window_menu_warning(), and ro_gui_window_prepare_pageinfo().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ content_get_type()

content_type content_get_type ( struct hlcache_handle h)

Retrieve computed type of content.

Parameters
hhandle to the content to retrieve type of.
Returns
Computed content type

Definition at line 1061 of file content.c.

References CONTENT_NONE, content::handler, hlcache_handle_get_content(), and content_handler::type.

Referenced by ami_gui_menu_update_disabled(), ami_mime_content_to_filetype(), browser_window_callback(), browser_window_can_search(), browser_window_can_select(), browser_window_content_ready(), browser_window_create_frameset(), browser_window_create_frameset_internal(), browser_window_create_iframes(), browser_window_find_target(), browser_window_mouse_click_internal(), browser_window_navigate(), browser_window_recalculate_frameset(), browser_window_redraw(), browser_window_reload(), convert_script_sync_cb(), get_context_info(), get_mouse_action_node(), html_get_id_offset(), html_object_callback(), html_object_close_objects(), html_object_free_objects(), html_object_open_objects(), html_object_refresh(), html_redraw_box(), html_script_exec(), layout_block_add_scrollbar(), layout_block_find_dimensions(), layout_calculate_descendant_bboxes(), layout_float_find_dimensions(), layout_minmax_block(), layout_update_descendant_bbox(), nsgtk_viewsource(), print_button_clicked_cb(), print_document(), ro_content_filetype(), ro_gui_save_content(), ro_gui_search_bw_searchable(), ro_gui_url_bar_set_site_favicon(), ro_gui_window_content_export_types(), ro_gui_window_menu_warning(), ro_gui_window_prepare_pageinfo(), save_as_text(), save_complete_save_html(), save_complete_save_html_object(), and theme_install_start().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ content_get_width()

int content_get_width ( struct hlcache_handle h)

Retrieve width of content.

Parameters
hhandle to the content to get width of.
Returns
Content width

Definition at line 1158 of file content.c.

References content__get_width(), and hlcache_handle_get_content().

Referenced by bitmap_render(), browser_window_content_done(), browser_window_get_extents(), browser_window_handle_scrollbars(), browser_window_history_update(), browser_window_redraw(), html_object_callback(), html_redraw_background(), html_redraw_inline_background(), layout_calculate_descendant_bboxes(), layout_get_object_dimensions(), layout_lists(), layout_minmax_block(), print_apply_settings(), print_declare_fonts(), print_document(), and ro_gui_url_bar_set_site_favicon().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ content_invalidate_reuse_data()

void content_invalidate_reuse_data ( struct hlcache_handle h)

Invalidate content reuse data.

causes subsequent requests for content URL to query server to determine if content can be reused. This is required behaviour for forced reloads etc.

Parameters
hContent handle to invalidate.

Definition at line 1229 of file content.c.

References content__invalidate_reuse_data(), and hlcache_handle_get_content().

Referenced by browser_window_refresh(), browser_window_reload(), html_object_refresh(), nsbeos_scaffolding_dispatch_event(), ro_gui_window_menu_select(), and theme_install_start().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ content_redraw()

bool content_redraw ( struct hlcache_handle h,
struct content_redraw_data data,
const struct rect clip,
const struct redraw_context ctx 
)

Display content on screen with optional tiling.

Parameters
hThe content to redraw.
dataThe contents redraw data.
clipThe clipping rectangle to use when redrawing the content.
ctxcurrent redraw context.
Returns
true if successful otherwise false.

Calls the redraw function for the content.

Definition at line 558 of file content.c.

References clip(), content::handler, hlcache_handle_get_content(), content::locked, and content_handler::redraw.

Referenced by browser_window_redraw(), html_redraw_background(), html_redraw_box(), html_redraw_inline_background(), print_declare_fonts(), print_document(), print_draw_next_page(), ro_gui_url_bar_redraw(), treeview_redraw(), treeview_redraw_search(), and treeview_redraw_tree().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ content_scaled_redraw()

bool content_scaled_redraw ( struct hlcache_handle h,
int  width,
int  height,
const struct redraw_context ctx 
)

Redraw a content with scale set for horizontal fit.

Redraws the content at a specified width and height with the content drawing scaled to fit within the area.

Parameters
hThe content to redraw
widthThe target width
heightThe target height
ctxcurrent redraw context
Returns
true if successful, false otherwise

The thumbnail is guaranteed to be filled to its width/height extents, so there is no need to render a solid background first.

Units for width and height are pixels.

Definition at line 583 of file content.c.

References content_redraw_data::background_colour, clip(), plotter_table::clip, content::handler, height, content_redraw_data::height, hlcache_handle_get_content(), knockout_plot_end(), knockout_plot_start(), content::locked, NSERROR_OK, NSLOG, plotter_table::option_knockout, redraw_context::plot, plot_style_fill_white, plotter_table::rectangle, content_handler::redraw, content_redraw_data::repeat_x, content_redraw_data::repeat_y, content_redraw_data::scale, content::width, width, content_redraw_data::width, content_redraw_data::x, and content_redraw_data::y.

Referenced by bitmap_render(), and riscos_bitmap_render().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ hlcache_handle_get_url()

struct nsurl * hlcache_handle_get_url ( const struct hlcache_handle handle)