Mercurial > dillo_port1.3
changeset 11:4a5942beffdf
Added some "const" qualifiers.
author | jcid |
---|---|
date | Sun, 14 Oct 2007 04:21:53 +0200 |
parents | f30c923e31aa |
children | 55c4fdb2b9d6 |
files | src/bookmark.c src/bookmark.h src/history.c src/history.h src/menu.cc src/menu.hh src/uicmd.cc src/uicmd.hh |
diffstat | 8 files changed, 24 insertions(+), 23 deletions(-) [+] |
line wrap: on
line diff
--- a/src/bookmark.c Sun Oct 14 02:09:40 2007 +0200 +++ b/src/bookmark.c Sun Oct 14 04:21:53 2007 +0200 @@ -71,7 +71,7 @@ /* * Add the new bookmark through the bookmarks server */ -void a_Bookmarks_add(BrowserWindow *bw, DilloUrl *url) +void a_Bookmarks_add(BrowserWindow *bw, const DilloUrl *url) { const char *title; char *cmd;
--- a/src/bookmark.h Sun Oct 14 02:09:40 2007 +0200 +++ b/src/bookmark.h Sun Oct 14 04:21:53 2007 +0200 @@ -7,7 +7,7 @@ extern "C" { #endif /* __cplusplus */ -void a_Bookmarks_add(BrowserWindow *bw, DilloUrl *url); +void a_Bookmarks_add(BrowserWindow *bw, const DilloUrl *url); /* todo: this is for testing purposes */ void a_Bookmarks_chat_add(BrowserWindow *Bw, char *Cmd, char *answer);
--- a/src/history.c Sun Oct 14 02:09:40 2007 +0200 +++ b/src/history.c Sun Oct 14 04:21:53 2007 +0200 @@ -92,7 +92,7 @@ * Return the title camp (by url) * ('force' returns URL_STR when there's no title) */ -const char *a_History_get_title_by_url(DilloUrl *url, int force) +const char *a_History_get_title_by_url(const DilloUrl *url, int force) { int i;
--- a/src/history.h Sun Oct 14 02:09:40 2007 +0200 +++ b/src/history.h Sun Oct 14 04:21:53 2007 +0200 @@ -13,7 +13,7 @@ int a_History_set_title(int idx, const char *title); DilloUrl *a_History_get_url(int idx); const char *a_History_get_title(int idx, int force); -const char *a_History_get_title_by_url(DilloUrl *url, int force); +const char *a_History_get_title_by_url(const DilloUrl *url, int force); void a_History_free(void);
--- a/src/menu.cc Sun Oct 14 02:09:40 2007 +0200 +++ b/src/menu.cc Sun Oct 14 04:21:53 2007 +0200 @@ -31,7 +31,7 @@ // (This data can be encapsulated inside a class for each popup, but // as popups are modal, there's no need). // Weak reference to the popup's URL -static DilloUrl *popup_url = NULL; +static const DilloUrl *popup_url = NULL; // Weak reference to the popup's bw static BrowserWindow *popup_bw = NULL; // Weak reference to the page's HTML bugs @@ -68,7 +68,7 @@ //-------------------------------------------------------------------------- -static void Menu_link_cb(Widget* , void *v_url) +static void Menu_link_cb(Widget* ) { printf("Menu_link_cb: click! :-)\n"); } @@ -185,7 +185,7 @@ /* * Page popup menu (construction & popup) */ -void a_Menu_page_popup(BrowserWindow *bw, DilloUrl *url, const char *bugs_txt) +void a_Menu_page_popup(BrowserWindow *bw, const DilloUrl *url, const char *bugs_txt) { // One menu for every browser window static PopupMenu *pm = 0; @@ -234,7 +234,7 @@ /* * Link popup menu (construction & popup) */ -void a_Menu_link_popup(BrowserWindow *bw, DilloUrl *url) +void a_Menu_link_popup(BrowserWindow *bw, const DilloUrl *url) { // One menu for every browser window static PopupMenu *pm = 0; @@ -251,7 +251,7 @@ i = new Item("Bookmark this Link"); i->callback(Menu_add_bookmark_cb); i = new Item("Copy Link location"); - i->callback(Menu_link_cb, url); + i->callback(Menu_link_cb); i->deactivate(); new Divider(); i = new Item("Save Link As..."); @@ -270,7 +270,7 @@ /* * Bugmeter popup menu (construction & popup) */ -void a_Menu_bugmeter_popup(BrowserWindow *bw, DilloUrl *url) +void a_Menu_bugmeter_popup(BrowserWindow *bw, const DilloUrl *url) { // One menu for every browser window static PopupMenu *pm = 0;
--- a/src/menu.hh Sun Oct 14 02:09:40 2007 +0200 +++ b/src/menu.hh Sun Oct 14 04:21:53 2007 +0200 @@ -7,9 +7,10 @@ extern "C" { #endif /* __cplusplus */ -void a_Menu_page_popup(BrowserWindow *bw, DilloUrl *url, const char *bugs_txt); -void a_Menu_link_popup(BrowserWindow *bw, DilloUrl *url); -void a_Menu_bugmeter_popup(BrowserWindow *bw, DilloUrl *url); +void a_Menu_page_popup(BrowserWindow *bw, const DilloUrl *url, + const char *bugs_txt); +void a_Menu_link_popup(BrowserWindow *bw, const DilloUrl *url); +void a_Menu_bugmeter_popup(BrowserWindow *bw, const DilloUrl *url); void a_Menu_history_popup(BrowserWindow *bw, int direction); //---------------------
--- a/src/uicmd.cc Sun Oct 14 02:09:40 2007 +0200 +++ b/src/uicmd.cc Sun Oct 14 04:21:53 2007 +0200 @@ -181,7 +181,7 @@ /* * Open a new URL in the given browser window */ -void a_UIcmd_open_url_nw(BrowserWindow *bw, DilloUrl *url) +void a_UIcmd_open_url_nw(BrowserWindow *bw, const DilloUrl *url) { a_Nav_push_nw(bw, url); } @@ -426,7 +426,7 @@ /* * Add a bookmark for a certain URL */ -void a_UIcmd_add_bookmark(BrowserWindow *bw, DilloUrl *url) +void a_UIcmd_add_bookmark(BrowserWindow *bw, const DilloUrl *url) { a_Bookmarks_add(bw, url); } @@ -435,7 +435,7 @@ /* * Popup the page menu */ -void a_UIcmd_page_popup(void *vbw, DilloUrl *url, const char *bugs_txt) +void a_UIcmd_page_popup(void *vbw, const DilloUrl *url, const char *bugs_txt) { a_Menu_page_popup((BrowserWindow*)vbw, url, bugs_txt); } @@ -443,7 +443,7 @@ /* * Popup the link menu */ -void a_UIcmd_link_popup(void *vbw, DilloUrl *url) +void a_UIcmd_link_popup(void *vbw, const DilloUrl *url) { a_Menu_link_popup((BrowserWindow*)vbw, url); } @@ -451,7 +451,7 @@ /* * Show a text window with the URL's source */ -void a_UIcmd_view_page_source(DilloUrl *url) +void a_UIcmd_view_page_source(const DilloUrl *url) { char *buf; int buf_size;
--- a/src/uicmd.hh Sun Oct 14 02:09:40 2007 +0200 +++ b/src/uicmd.hh Sun Oct 14 04:21:53 2007 +0200 @@ -10,7 +10,7 @@ BrowserWindow *a_UIcmd_browser_window_new(int ww, int wh); void a_UIcmd_open_urlstr(void *vbw, const char *urlstr); -void a_UIcmd_open_url_nw(BrowserWindow *bw, DilloUrl *url); +void a_UIcmd_open_url_nw(BrowserWindow *bw, const DilloUrl *url); void a_UIcmd_back(void *vbw); void a_UIcmd_back_popup(void *vbw); void a_UIcmd_forw(void *vbw); @@ -24,11 +24,11 @@ void a_UIcmd_open_url_dialog(void *vbw); void a_UIcmd_search_dialog(void *vbw); void a_UIcmd_book(void *vbw); -void a_UIcmd_add_bookmark(BrowserWindow *bw, DilloUrl *url); +void a_UIcmd_add_bookmark(BrowserWindow *bw, const DilloUrl *url); void a_UIcmd_fullscreen_toggle(BrowserWindow *bw); -void a_UIcmd_page_popup(void *vbw, DilloUrl *url, const char *bugs_txt); -void a_UIcmd_link_popup(void *vbw, DilloUrl *url); -void a_UIcmd_view_page_source(DilloUrl *url); +void a_UIcmd_page_popup(void *vbw, const DilloUrl *url, const char *bugs_txt); +void a_UIcmd_link_popup(void *vbw, const DilloUrl *url); +void a_UIcmd_view_page_source(const DilloUrl *url); void a_UIcmd_view_page_bugs(void *vbw); void a_UIcmd_bugmeter_popup(void *vbw); int *a_UIcmd_get_history(BrowserWindow *bw, int direction);