From 214478fc15a2b9ee67e19e08cf27657c0157037a Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Sat, 22 Feb 2020 20:59:44 +0000 Subject: Improve some content documentation comments --- content/content.h | 148 ++++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 110 insertions(+), 38 deletions(-) (limited to 'content/content.h') diff --git a/content/content.h b/content/content.h index 0dbd58d95..144a698c1 100644 --- a/content/content.h +++ b/content/content.h @@ -100,67 +100,118 @@ struct content_rfc5988_link { /** Extra data for some content_msg messages. */ union content_msg_data { - /** CONTENT_MSG_LOG - Information for logging */ + /** + * CONTENT_MSG_LOG - Information for logging + */ struct { - browser_window_console_source src; /**< The source of the logging */ - const char *msg; /**< The message to log */ - size_t msglen; /**< The length of that message */ - browser_window_console_flags flags; /**< The flags of the logging */ + /** The source of the logging */ + browser_window_console_source src; + /** The message to log */ + const char *msg; + /** The length of that message */ + size_t msglen; + /** The flags of the logging */ + browser_window_console_flags flags; } log; - /** CONTENT_MSG_SSL_CERTS - The certificate chain from the underlying fetch */ + + /** + * CONTENT_MSG_SSL_CERTS - The certificate chain from the + * underlying fetch + */ struct { const struct ssl_cert_info *certs; /**< The chain */ size_t num; /**< The number of certs in the chain */ } certs; - /** CONTENT_MSG_ERROR - Error from content or underlying fetch */ + + /** + * CONTENT_MSG_ERROR - Error from content or underlying fetch + */ struct { - nserror errorcode; /**< The error code to convey meaning */ - const char *errormsg; /**< The message. - * if NSERROR_UNKNOWN then this is the - * direct message, otherwise is some - * kind of metadata (e.g. a message name - * or somesuch) but always a nul - * terminated string. - */ + /** + * The error code to convey meaning + */ + nserror errorcode; + /** + * The message. if NSERROR_UNKNOWN then this is the direct + * message, otherwise is some kind of metadata (e.g. a + * message name or somesuch) but always a null terminated + * string. + */ + const char *errormsg; } errordata; - /** CONTENT_MSG_REDIRECT - Redirect info */ + + /** + * CONTENT_MSG_REDIRECT - Redirect info + */ struct { struct nsurl *from; /**< Redirect origin */ struct nsurl *to; /**< Redirect target */ } redirect; /**< Fetch URL redirect occured */ - /** CONTENT_MSG_REDRAW - Area of content which needs redrawing */ + + /** + * CONTENT_MSG_REDRAW - Area of content which needs redrawing + */ struct { int x, y, width, height; } redraw; - /** CONTENT_MSG_REFRESH - Minimum delay */ + + /** + * CONTENT_MSG_REFRESH - Minimum delay + */ int delay; - /** CONTENT_MSG_REFORMAT - Reformat should not cause a redraw */ + + /** + * CONTENT_MSG_REFORMAT - Reformat should not cause a redraw + */ bool background; - /** CONTENT_MSG_STATUS - Status message update. If NULL, the content's - * internal status text has been updated, and listener should use - * content_get_status_message() */ + + /** + * CONTENT_MSG_STATUS - Status message update. If NULL, the + * content's internal status text has been updated, and + * listener should use content_get_status_message() + */ const char *explicit_status_text; - /** CONTENT_MSG_DOWNLOAD - Low-level cache handle */ + + /** + * CONTENT_MSG_DOWNLOAD - Low-level cache handle + */ struct llcache_handle *download; - /** CONTENT_MSG_RFC5988_LINK - rfc5988 link data */ + + /** + * CONTENT_MSG_RFC5988_LINK - rfc5988 link data + */ struct content_rfc5988_link *rfc5988_link; - /** CONTENT_MSG_GETCTX - Javascript context */ + + /** + * CONTENT_MSG_GETCTX - Javascript context + */ struct jscontext **jscontext; - /** CONTENT_MSG_GETDIMS - Get the viewport dimensions */ + + /** + * CONTENT_MSG_GETDIMS - Get the viewport dimensions + */ struct { - /* TODO: Consider getting screen_width, screen_height too. */ + /** \todo Consider getting screen_width, screen_height too. */ unsigned *viewport_width; unsigned *viewport_height; } getdims; - /** CONTENT_MSG_SCROLL - Part of content to scroll to show */ + + /** + * CONTENT_MSG_SCROLL - Part of content to scroll to show + */ struct { - /** if true, scroll to show area given by (x0, y0) and (x1,y1). - * if false, scroll point (x0, y0) to top left of viewport */ + /* + * if true, scroll to show area given by (x0, y0) and (x1,y1). + * if false, scroll point (x0, y0) to top left of viewport + */ bool area; int x0, y0; int x1, y1; } scroll; - /** CONTENT_MSG_DRAGSAVE - Drag save a content */ + + /** + * CONTENT_MSG_DRAGSAVE - Drag save a content + */ struct { enum { CONTENT_SAVE_ORIG, @@ -171,19 +222,31 @@ union content_msg_data { /** if NULL, save the content generating the message */ struct hlcache_handle *content; } dragsave; - /** CONTENT_MSG_SAVELINK - Save a URL */ + + /** + * CONTENT_MSG_SAVELINK - Save a URL + */ struct { struct nsurl *url; const char *title; } savelink; - /** CONTENT_MSG_POINTER - Mouse pointer to set */ + + /** + * CONTENT_MSG_POINTER - Mouse pointer to set + */ browser_pointer_shape pointer; - /** CONTENT_MSG_SELECTION - Selection made or cleared */ + + /** + * CONTENT_MSG_SELECTION - Selection made or cleared + */ struct { bool selection; /**< false for selection cleared */ bool read_only; } selection; - /** CONTENT_MSG_CARET - set caret position or, hide caret */ + + /** + * CONTENT_MSG_CARET - set caret position or, hide caret + */ struct { enum { CONTENT_CARET_SET_POS, @@ -197,7 +260,10 @@ union content_msg_data { const struct rect *clip; /**< Carret clip rect */ } pos; /**< With CONTENT_CARET_SET_POS */ } caret; - /** CONTENT_MSG_DRAG - Drag start or end */ + + /** + * CONTENT_MSG_DRAG - Drag start or end + */ struct { enum { CONTENT_DRAG_NONE, @@ -206,11 +272,17 @@ union content_msg_data { } type; const struct rect *rect; } drag; - /** CONTENT_MSG_SELECTMENU - Create select menu at pointer */ + + /** + * CONTENT_MSG_SELECTMENU - Create select menu at pointer + */ struct { struct form_control *gadget; } select_menu; - /** CONTENT_MSG_GADGETCLICK - User clicked on a form gadget */ + + /** + * CONTENT_MSG_GADGETCLICK - User clicked on a form gadget + */ struct { struct form_control *gadget; } gadget_click; -- cgit v1.2.3