From 65b356ba75363d3dd3c44cd546a487524a2522ce Mon Sep 17 00:00:00 2001 From: James Bursa Date: Sat, 11 Nov 2006 19:46:51 +0000 Subject: [PATCH] Documentation moved to Docs/01-content svn path=/trunk/netsurf/; revision=3050 --- content/content.h | 88 ----------------------------------------------- 1 file changed, 88 deletions(-) diff --git a/content/content.h b/content/content.h index ec050a7be..ec4bc1add 100644 --- a/content/content.h +++ b/content/content.h @@ -10,94 +10,6 @@ * Content handling (interface). * * The content functions manipulate struct contents, which correspond to URLs. - * - * Each content has a type. The type is used to call a specific implementation - * of functions such as content_process_data(). - * - * The source data fetched from the URL is placed in the source_data buffer as - * it arrives. - * - * Contents have an associated set of users, which are informed by a callback - * when the state of the content changes or something interesting happens. - * - * Depending on the type of content, there may be either one content structure - * per URL which is shared among all users, or one per URL per user. For - * example, CONTENT_JPEGs are shared, while there is one CONTENT_HTML per user - * (because each instance of an HTML page may have different parameters such as - * window width). This is controlled by no_share in ::handler_map. - * - * The status of a content follows a fixed order. Certain content functions - * change the state, and each change of state results in a message to all users - * of the content. The diagram below shows this: - * \dot - * digraph status { - * node [shape=plaintext, fontname=Helvetica, fontsize=9]; - * edge [fontname=Helvetica, fontsize=9]; - * - * content_create -> TYPE_UNKNOWN [style=bold]; - * TYPE_UNKNOWN -> content_set_type [style=bold]; - * content_set_type -> LOADING [label=MSG_LOADING, style=bold]; - * content_set_type -> LOADING [label="MSG_NEWPTR\nMSG_LOADING"]; - * content_set_type -> ERROR [label=MSG_ERROR]; - * LOADING -> content_process_data [style=bold]; - * content_process_data -> LOADING [style=bold]; - * content_process_data -> ERROR [label=MSG_ERROR]; - * LOADING -> content_convert [style=bold]; - * content_convert -> READY [label=MSG_READY, style=bold]; - * content_convert -> DONE [label="MSG_READY\nMSG_DONE", style=bold]; - * content_convert -> ERROR [label=MSG_ERROR]; - * READY -> READY [style=bold]; - * READY -> DONE [label=MSG_DONE, style=bold]; - * READY -> content_stop; - * content_stop -> DONE [label=MSG_DONE]; - * - * TYPE_UNKNOWN [shape=ellipse]; - * LOADING [shape=ellipse]; - * READY [shape=ellipse]; - * DONE [shape=ellipse]; - * ERROR [shape=ellipse]; - * } - * \enddot - * - * To implement a new content type, implement the following functions: - * - * - type_create(): called to initialise type-specific fields in the - * content structure. Optional. - * - * - type_process_data(): called when some data arrives. Optional. - * - * - type_convert(): called when data has finished arriving. The - * content needs to be converted for display. Must set the status to one of - * CONTENT_STATUS_READY or CONTENT_STATUS_DONE if no error occurs. Optional, - * but probably required for non-trivial types. - * - * - type_reformat(): called when, for example, the window has been - * resized, and the content needs reformatting for the new size. Optional. - * - * - type_destroy(): called when the content is being destroyed. Free all - * resources. Optional. - * - * - type_redraw(): called to plot the content to screen. - * - * - type_stop(): called when the user interrupts in status - * CONTENT_STATUS_READY. Must stop any processing and set the status to - * CONTENT_STATUS_DONE. Required iff the status can be CONTENT_STATUS_READY. - * - * - type_open(): called when a window containing the content is - * opened. Probably only makes sense if no_share is set for the content type - * in handler_map. Optional. - * - * - type_close(): called when the window containing the content is - * closed. Optional. - * - * - type_create(), type_process_data(), type_convert(): - * if an error occurs, must broadcast CONTENT_MSG_ERROR and return false. - * Optionally use warn_user() for serious errors. The _destroy function will - * be called soon after. - * - * Each content structure is allocated using talloc, and all data related to a - * content should be allocated as a child block of the content structure using - * talloc. This will ensure that all memory used by a page is freed. */ #ifndef _NETSURF_DESKTOP_CONTENT_H_