From 9ab3912ac73bfeca7da77aa9463d758ee01659d2 Mon Sep 17 00:00:00 2001 From: jcid Date: Sun, 14 Oct 2007 04:21:53 +0200 Subject: Added some "const" qualifiers. --- src/bookmark.c | 2 +- src/bookmark.h | 2 +- src/history.c | 2 +- src/history.h | 2 +- src/menu.cc | 12 ++++++------ src/menu.hh | 7 ++++--- src/uicmd.cc | 10 +++++----- src/uicmd.hh | 10 +++++----- 8 files changed, 24 insertions(+), 23 deletions(-) (limited to 'src') diff --git a/src/bookmark.c b/src/bookmark.c index af37bfed..46b63672 100644 --- a/src/bookmark.c +++ b/src/bookmark.c @@ -71,7 +71,7 @@ void a_Bookmarks_chat_add(BrowserWindow *Bw, char *Cmd, char *answer) /* * 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; diff --git a/src/bookmark.h b/src/bookmark.h index e1053204..de5884c5 100644 --- a/src/bookmark.h +++ b/src/bookmark.h @@ -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); diff --git a/src/history.c b/src/history.c index 7819e58e..49dbb966 100644 --- a/src/history.c +++ b/src/history.c @@ -92,7 +92,7 @@ const char *a_History_get_title(int idx, int force) * 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; diff --git a/src/history.h b/src/history.h index a6f9f13f..da520c87 100644 --- a/src/history.h +++ b/src/history.h @@ -13,7 +13,7 @@ int a_History_add_url(DilloUrl *url); 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); diff --git a/src/menu.cc b/src/menu.cc index a4c84b5c..62a5a880 100644 --- a/src/menu.cc +++ b/src/menu.cc @@ -31,7 +31,7 @@ using namespace fltk; // (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 @@ void NewItem::draw() { //-------------------------------------------------------------------------- -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 @@ static void Menu_history_cb(Widget *wid, void *data) /* * 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 @@ void a_Menu_page_popup(BrowserWindow *bw, DilloUrl *url, const char *bugs_txt) /* * 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 @@ void a_Menu_link_popup(BrowserWindow *bw, DilloUrl *url) 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 @@ void a_Menu_link_popup(BrowserWindow *bw, DilloUrl *url) /* * 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; diff --git a/src/menu.hh b/src/menu.hh index b9a2eb99..72c2bb1d 100644 --- a/src/menu.hh +++ b/src/menu.hh @@ -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); //--------------------- diff --git a/src/uicmd.cc b/src/uicmd.cc index 2596ba0a..2b3f0f48 100644 --- a/src/uicmd.cc +++ b/src/uicmd.cc @@ -181,7 +181,7 @@ void a_UIcmd_open_urlstr(void *vbw, const char *urlstr) /* * 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 @@ void a_UIcmd_book(void *vbw) /* * 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 @@ void a_UIcmd_add_bookmark(BrowserWindow *bw, DilloUrl *url) /* * 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 @@ void a_UIcmd_page_popup(void *vbw, DilloUrl *url, const char *bugs_txt) /* * 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 @@ void a_UIcmd_link_popup(void *vbw, DilloUrl *url) /* * 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; diff --git a/src/uicmd.hh b/src/uicmd.hh index 8ebbb086..4216dfb3 100644 --- a/src/uicmd.hh +++ b/src/uicmd.hh @@ -10,7 +10,7 @@ extern "C" { 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_file(void *vbw); 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); -- cgit v1.2.3