From 5562c9a553fe539d0d1fbf05dba89b1b1f577fae Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Sat, 8 Nov 2014 22:08:29 +0000 Subject: Continue doxygen error cleanup. --- atari/gui.c | 7 +-- atari/gui.h | 6 ++ beos/bitmap.cpp | 23 +++++--- beos/font.cpp | 5 +- beos/gui.cpp | 11 ++-- content/content.c | 131 ++++++++++++++++++-------------------------- content/content.h | 99 +++++++++++++++++++++++++++++---- content/content_protected.h | 59 +++++++++++++++++++- content/hlcache.c | 3 +- gtk/scaffolding.c | 11 +--- gtk/scaffolding.h | 9 ++- gtk/tabs.h | 7 ++- gtk/window.c | 2 +- 13 files changed, 244 insertions(+), 129 deletions(-) diff --git a/atari/gui.c b/atari/gui.c index 6a68b8250..279102d7c 100644 --- a/atari/gui.c +++ b/atari/gui.c @@ -356,12 +356,7 @@ static void gui_window_set_title(struct gui_window *gw, const char *title) } } -/** - * Set the status bar of a browser window. - * - * \param w gui_window to update - * \param text new status text - */ +/* exported interface documented in atari/gui.h */ void gui_window_set_status(struct gui_window *w, const char *text) { int l; diff --git a/atari/gui.h b/atari/gui.h index 68a416e0f..bbe129b7a 100755 --- a/atari/gui.h +++ b/atari/gui.h @@ -164,6 +164,12 @@ struct gui_window *gui_get_input_window(void); char *gui_window_get_url(struct gui_window *gw); char *gui_window_get_title(struct gui_window *gw); +/** + * Set the status bar of a browser window. + * + * \param w The gui_window to update. + * \param text new status text + */ void gui_window_set_status(struct gui_window *w, const char *text); void gui_window_set_pointer(struct gui_window *gw, gui_pointer_shape shape); void gui_window_destroy(struct gui_window *w); diff --git a/beos/bitmap.cpp b/beos/bitmap.cpp index 93a184356..1524aed0c 100644 --- a/beos/bitmap.cpp +++ b/beos/bitmap.cpp @@ -57,18 +57,23 @@ struct bitmap { #warning TODO: add correct locking (not strictly required) -/** Convert to BeOS RGBA32_LITTLE (strictly BGRA) from NetSurf's favoured ABGR format. +/** + * Convert to BeOS RGBA32_LITTLE (strictly BGRA) from NetSurf's favoured ABGR format. + * * Copies the converted data elsewhere. Operation is rotate left 8 bits. * - * \param pixels Array of 32-bit values, in the form of ABGR. This will - * be overwritten with new data in the form of BGRA. - * \param width Width of the bitmap - * \param height Height of the bitmap - * \param rowstride Number of bytes to skip after each row (this - * implementation requires this to be a multiple of 4.) + * \param src Source 32-bit pixels arranged in ABGR order. + * \param dst Output data in BGRA order. + * \param width Width of the bitmap + * \param height Height of the bitmap + * \param rowstride Number of bytes to skip after each row (this implementation + * requires this to be a multiple of 4.) */ -static inline void nsbeos_rgba_to_bgra(void *src, void *dst, int width, int height, - size_t rowstride) +static inline void nsbeos_rgba_to_bgra(void *src, + void *dst, + int width, + int height, + size_t rowstride) { struct abgr { uint8 a, b, g, r; }; struct rgba { uint8 r, g, b ,a; }; diff --git a/beos/font.cpp b/beos/font.cpp index 5b3ef8bce..ba6803f53 100644 --- a/beos/font.cpp +++ b/beos/font.cpp @@ -288,10 +288,9 @@ bool nsfont_paint(const plot_font_style_t *fstyle, /** * Convert a font style to a PangoFontDescription. * - * \param fstyle style for this text - * \return a new Pango font description + * \param font Beos font object. + * \param fstyle style for this text */ - void nsbeos_style_to_font(BFont &font, const plot_font_style_t *fstyle) { float size; diff --git a/beos/gui.cpp b/beos/gui.cpp index ca895894b..7c0a3c6f2 100644 --- a/beos/gui.cpp +++ b/beos/gui.cpp @@ -248,16 +248,15 @@ image_id nsbeos_find_app_path(char *path) /** * Locate a shared resource file by searching known places in order. * + * Search order is: ~/config/settings/NetSurf/, ~/.netsurf/, $NETSURFRES/ + * (where NETSURFRES is an environment variable), and finally the path + * specified by the macro at the top of this file. + * * \param buf buffer to write to. must be at least PATH_MAX chars * \param filename file to look for * \param def default to return if file not found - * \return buf - * - * Search order is: ~/config/settings/NetSurf/, ~/.netsurf/, $NETSURFRES/ - * (where NETSURFRES is an environment variable), and finally the path - * specified by the #define at the top of this file. + * \return path to resource. */ - static char *find_resource(char *buf, const char *filename, const char *def) { const char *cdir = NULL; diff --git a/content/content.c b/content/content.c index 1316497a9..eca3f61c2 100644 --- a/content/content.c +++ b/content/content.c @@ -17,10 +17,7 @@ */ /** \file - * Content handling (implementation). - * - * This implementation is based on the ::handler_map array, which maps - * ::content_type to the functions which implement that type. + * Content handling implementation. */ #include @@ -894,20 +891,8 @@ void content_add_error(struct content *c, const char *token, { } -bool content__set_title(struct content *c, const char *title) -{ - char *new_title = strdup(title); - if (new_title == NULL) - return false; - - if (c->title != NULL) - free(c->title); - - c->title = new_title; - - return true; -} +/* exported interface documented in content/content.h */ struct content_rfc5988_link * content_find_rfc5988_link(hlcache_handle *h, lwc_string *rel) { @@ -999,12 +984,24 @@ bool content__add_rfc5988_link(struct content *c, return true; } + + /** - * Retrieve computed type of content + * Retrieve URL associated with content * - * \param c Content to retrieve type of - * \return Computed content type + * \param c Content to retrieve URL from + * \return Pointer to URL, or NULL if not found. */ +nsurl *content_get_url(struct content *c) +{ + if (c == NULL) + return NULL; + + return llcache_handle_get_url(c->llcache); +} + + +/* exported interface documented in content/content.h */ content_type content_get_type(hlcache_handle *h) { struct content *c = hlcache_handle_get_content(h); @@ -1015,17 +1012,14 @@ content_type content_get_type(hlcache_handle *h) return c->handler->type(); } -/** - * Retrieve mime-type of content - * - * \param c Content to retrieve mime-type of - * \return Pointer to referenced mime-type, or NULL if not found. - */ + +/* exported interface documented in content/content.h */ lwc_string *content_get_mime_type(hlcache_handle *h) { return content__get_mime_type(hlcache_handle_get_content(h)); } +/* exported interface documented in content/content_protected.h */ lwc_string *content__get_mime_type(struct content *c) { if (c == NULL) @@ -1034,31 +1028,30 @@ lwc_string *content__get_mime_type(struct content *c) return lwc_string_ref(c->mime_type); } -/** - * Retrieve URL associated with content - * - * \param c Content to retrieve URL from - * \return Pointer to URL, or NULL if not found. - */ -nsurl *content_get_url(struct content *c) + +/* exported interface documented in content/content_protected.h */ +bool content__set_title(struct content *c, const char *title) { - if (c == NULL) - return NULL; + char *new_title = strdup(title); + if (new_title == NULL) + return false; - return llcache_handle_get_url(c->llcache); + if (c->title != NULL) + free(c->title); + + c->title = new_title; + + return true; } -/** - * Retrieve title associated with content - * - * \param c Content to retrieve title from - * \return Pointer to title, or NULL if not found. - */ + +/* exported interface documented in content/content.h */ const char *content_get_title(hlcache_handle *h) { return content__get_title(hlcache_handle_get_content(h)); } +/* exported interface documented in content/content_protected.h */ const char *content__get_title(struct content *c) { if (c == NULL) @@ -1068,17 +1061,14 @@ const char *content__get_title(struct content *c) nsurl_access(llcache_handle_get_url(c->llcache)); } -/** - * Retrieve status of content - * - * \param c Content to retrieve status of - * \return Content status - */ + +/* exported interface documented in content/content.h */ content_status content_get_status(hlcache_handle *h) { return content__get_status(hlcache_handle_get_content(h)); } +/* exported interface documented in content/content_protected.h */ content_status content__get_status(struct content *c) { if (c == NULL) @@ -1087,17 +1077,14 @@ content_status content__get_status(struct content *c) return c->status; } -/** - * Retrieve status message associated with content - * - * \param c Content to retrieve status message from - * \return Pointer to status message, or NULL if not found. - */ + +/* exported interface documented in content/content.h */ const char *content_get_status_message(hlcache_handle *h) { return content__get_status_message(hlcache_handle_get_content(h)); } +/* exported interface documented in content/content_protected.h */ const char *content__get_status_message(struct content *c) { if (c == NULL) @@ -1106,17 +1093,14 @@ const char *content__get_status_message(struct content *c) return c->status_message; } -/** - * Retrieve width of content - * - * \param c Content to retrieve width of - * \return Content width - */ + +/* exported interface documented in content/content.h */ int content_get_width(hlcache_handle *h) { return content__get_width(hlcache_handle_get_content(h)); } +/* exported interface documented in content/content_protected.h */ int content__get_width(struct content *c) { if (c == NULL) @@ -1125,17 +1109,14 @@ int content__get_width(struct content *c) return c->width; } -/** - * Retrieve height of content - * - * \param c Content to retrieve height of - * \return Content height - */ + +/* exported interface documented in content/content.h */ int content_get_height(hlcache_handle *h) { return content__get_height(hlcache_handle_get_content(h)); } +/* exported interface documented in content/content_protected.h */ int content__get_height(struct content *c) { if (c == NULL) @@ -1144,17 +1125,14 @@ int content__get_height(struct content *c) return c->height; } -/** - * Retrieve available width of content - * - * \param h handle to the content. - * \return Available width of content. - */ + +/* exported interface documented in content/content.h */ int content_get_available_width(hlcache_handle *h) { return content__get_available_width(hlcache_handle_get_content(h)); } +/* exported interface documented in content/content_protected.h */ int content__get_available_width(struct content *c) { if (c == NULL) @@ -1164,18 +1142,13 @@ int content__get_available_width(struct content *c) } -/** - * Retrieve source of content - * - * \param c Content to retrieve source of - * \param size Pointer to location to receive byte size of source - * \return Pointer to source data - */ +/* exported interface documented in content/content.h */ const char *content_get_source_data(hlcache_handle *h, unsigned long *size) { return content__get_source_data(hlcache_handle_get_content(h), size); } +/* exported interface documented in content/content_protected.h */ const char *content__get_source_data(struct content *c, unsigned long *size) { const uint8_t *data; diff --git a/content/content.h b/content/content.h index 5f7d53a70..b0f2c099c 100644 --- a/content/content.h +++ b/content/content.h @@ -250,7 +250,6 @@ void content_remove_user(struct content *c, uint32_t content_count_users(struct content *c); bool content_matches_quirks(struct content *c, bool quirks); bool content_is_shareable(struct content *c); -content_status content__get_status(struct content *c); const struct llcache_handle *content_get_llcache_handle(struct content *c); nsurl *content_get_url(struct content *c); @@ -315,19 +314,99 @@ nserror content_debug_dump(struct hlcache_handle *h, FILE *f, enum content_debug */ nserror content_debug(struct hlcache_handle *h, enum content_debug op); -struct content_rfc5988_link *content_find_rfc5988_link(struct hlcache_handle *c, +/** + * find link in content that matches the rel string. + * + * \param h handle to the content to retrieve tyoe of. + * \param rel The string to match. + * \return A matching rfc5988 link or NULL if none is found. + * + */ +struct content_rfc5988_link *content_find_rfc5988_link(struct hlcache_handle *h, lwc_string *rel); /* Member accessors */ + +/** + * Retrieve computed type of content + * + * \param h handle to the content to retrieve tyoe of. + * \return Computed content type + */ content_type content_get_type(struct hlcache_handle *c); -lwc_string *content_get_mime_type(struct hlcache_handle *c); -const char *content_get_title(struct hlcache_handle *c); -content_status content_get_status(struct hlcache_handle *c); -const char *content_get_status_message(struct hlcache_handle *c); -int content_get_width(struct hlcache_handle *c); -int content_get_height(struct hlcache_handle *c); -int content_get_available_width(struct hlcache_handle *c); -const char *content_get_source_data(struct hlcache_handle *c, + +/** + * Retrieve mime-type of content + * + * \param h handle to the content to retrieve mime type from + * \return Pointer to referenced mime type, or NULL if not found. + */ +lwc_string *content_get_mime_type(struct hlcache_handle *h); + +/** + * Retrieve title associated with content + * + * \param h handle to the content to retrieve title from + * \return Pointer to title, or NULL if not found. + */ +const char *content_get_title(struct hlcache_handle *h); + +/** + * Retrieve status of content + * + * \param h handle to the content to retrieve status from + * \return Content status + */ +content_status content_get_status(struct hlcache_handle *h); + +/** + * Retrieve status of content + * + * \param c Content to retrieve status from. + * \return Content status + */ +content_status content__get_status(struct content *c); + +/** + * Retrieve status message associated with content + * + * \param h handle to the content to retrieve status message from + * \return Pointer to status message, or NULL if not found. + */ +const char *content_get_status_message(struct hlcache_handle *h); + +/** + * Retrieve width of content + * + * \param h handle to the content to get width of. + * \return Content width + */ +int content_get_width(struct hlcache_handle *h); + +/** + * Retrieve height of content + * + * \param h handle to the content to get height of. + * \return Content height + */ +int content_get_height(struct hlcache_handle *h); + +/** + * Retrieve available width of content + * + * \param h handle to the content to get available width of. + * \return Available width of content. + */ +int content_get_available_width(struct hlcache_handle *h); + +/** + * Retrieve source of content + * + * \param h Content handle to retrieve source of + * \param size Pointer to location to receive byte size of source + * \return Pointer to source data + */ +const char *content_get_source_data(struct hlcache_handle *h, unsigned long *size); /** diff --git a/content/content_protected.h b/content/content_protected.h index 1ae899891..d22ff4b22 100644 --- a/content/content_protected.h +++ b/content/content_protected.h @@ -185,14 +185,71 @@ void content__reformat(struct content *c, bool background, void content__request_redraw(struct content *c, int x, int y, int width, int height); -bool content__set_title(struct content *c, const char *title); +/** + * Retrieve mime-type of content + * + * \param c Content to retrieve mime-type of + * \return Pointer to referenced mime-type, or NULL if not found. + */ lwc_string *content__get_mime_type(struct content *c); + +/** + * Set title associated with content + * + * \param c Content to set title on. + * \parm title The new title to set. + * \return true on sucess else false. + */ +bool content__set_title(struct content *c, const char *title); + +/** + * Retrieve title associated with content + * + * \param c Content to retrieve title from + * \return Pointer to title, or NULL if not found. + */ const char *content__get_title(struct content *c); + +/** + * Retrieve status message associated with content + * + * \param c Content to retrieve status message from + * \return Pointer to status message, or NULL if not found. + */ const char *content__get_status_message(struct content *c); + +/** + * Retrieve width of content + * + * \param c Content to retrieve width of + * \return Content width + */ int content__get_width(struct content *c); + +/** + * Retrieve height of content + * + * \param c Content to retrieve height of + * \return Content height + */ int content__get_height(struct content *c); + +/** + * Retrieve available width of content + * + * \param c content to get available width of. + * \return Available width of content. + */ int content__get_available_width(struct content *c); + +/** + * Retrieve source of content. + * + * \param c Content to retrieve source of. + * \param size Pointer to location to receive byte size of source. + * \return Pointer to source data. + */ const char *content__get_source_data(struct content *c, unsigned long *size); /** diff --git a/content/hlcache.c b/content/hlcache.c index 6cfcba328..6e991281d 100644 --- a/content/hlcache.c +++ b/content/hlcache.c @@ -113,8 +113,7 @@ static void hlcache_clean(void *ignored) if (entry->content == NULL) continue; - if (content__get_status(entry->content) == - CONTENT_STATUS_LOADING) + if (content__get_status(entry->content) == CONTENT_STATUS_LOADING) continue; if (content_count_users(entry->content) != 0) diff --git a/gtk/scaffolding.c b/gtk/scaffolding.c index d18044069..7e6692a3c 100644 --- a/gtk/scaffolding.c +++ b/gtk/scaffolding.c @@ -2257,13 +2257,8 @@ struct nsgtk_scaffolding *nsgtk_new_scaffolding(struct gui_window *toplevel) return g; } -/** - * set the title in the window - * - * \param gw The gui window to set title on - * \param title The title to set (may be NULL) - */ -void gui_window_set_title(struct gui_window *gw, const char *title) +/* exported function documented in gtk/scaffolding.h */ +void nsgtk_window_set_title(struct gui_window *gw, const char *title) { struct nsgtk_scaffolding *gs = nsgtk_get_scaffold(gw); int title_len; @@ -2632,7 +2627,7 @@ void nsgtk_scaffolding_set_top_level(struct gui_window *gw) nsgtk_scaffolding_set_icon(gw); /* Ensure the window's title bar is updated */ - gui_window_set_title(gw, browser_window_get_title(bw)); + nsgtk_window_set_title(gw, browser_window_get_title(bw)); } diff --git a/gtk/scaffolding.h b/gtk/scaffolding.h index 7d21a68d7..887d6587a 100644 --- a/gtk/scaffolding.h +++ b/gtk/scaffolding.h @@ -235,7 +235,14 @@ gboolean nsgtk_window_url_changed(GtkWidget *, GdkEventKey *, gpointer); nserror nsgtk_scaffolding_new_tab(struct gui_window *gw); /* core acessors */ -void gui_window_set_title(struct gui_window *g, const char *title); +/** + * set the title in the window + * + * \param gw The gui window to set title on + * \param title The title to set which may be NULL + */ +void nsgtk_window_set_title(struct gui_window *gw, const char *title); + nserror gui_window_set_url(struct gui_window *g, struct nsurl *url); void gui_window_start_throbber(struct gui_window *g); void gui_window_stop_throbber(struct gui_window *g); diff --git a/gtk/tabs.h b/gtk/tabs.h index 036efb1e5..440d61336 100644 --- a/gtk/tabs.h +++ b/gtk/tabs.h @@ -28,9 +28,10 @@ void nsgtk_tab_add(struct gui_window *window, GtkWidget *tab_contents, bool back * * The tab title will be set to the parameter * - * @note currently only called from gui_window_set_title() - * @param g the gui window to set tab title for. - * @param title The title text which may not be NULL. + * \note currently only called from nsgtk_window_set_title() + * + * \param g the gui window to set tab title for. + * \param title The title text which may not be NULL. */ void nsgtk_tab_set_title(struct gui_window *g, const char *title); void nsgtk_tab_options_changed(GtkNotebook *notebook); diff --git a/gtk/window.c b/gtk/window.c index 1f70822bf..1b6e6ccbe 100644 --- a/gtk/window.c +++ b/gtk/window.c @@ -1307,7 +1307,7 @@ static struct gui_window_table window_table = { .start_selection = gui_window_start_selection, /* from scaffold */ - .set_title = gui_window_set_title, + .set_title = nsgtk_window_set_title, .set_url = gui_window_set_url, .start_throbber = gui_window_start_throbber, .stop_throbber = gui_window_stop_throbber, -- cgit v1.2.3