changeset 22:571f09e42ab6

- Hooked "Activate" to the form_receiver. - Connected the plain page context menu. - Added code for the image menu (not hooked yet though). - Added a image-loading toggle button to the UI (not functional yet).
author jcid
date Mon, 29 Oct 2007 15:51:30 +0100
parents 5f70fced5e00
children 2eceffee74a6
files ChangeLog dillorc2 src/form.cc src/form.hh src/html.cc src/menu.cc src/menu.hh src/pixmaps.h src/plain.cc src/prefs.c src/prefs.h src/ui.cc src/ui.hh src/uicmd.cc src/uicmd.hh
diffstat 15 files changed, 277 insertions(+), 56 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Sun Oct 28 01:15:19 2007 +0200
+++ b/ChangeLog	Mon Oct 29 15:51:30 2007 +0100
@@ -40,6 +40,10 @@
  - Improved notification upon leaving links.
  - Implemented image-link URL showing in status bar.
  - Added missing size-parsing for the <hr> element.
+ - Hooked "Activate" to the form_receiver.
+ - Connected the plain page context menu.
+ - Added code for the image menu (not hooked yet though).
+ - Added a image-loading toggle button to the UI (not functional yet).
    Patches: place
 +- Fixed a problem with locally-installed dpis.
    Patch: place, Jorge Arellano
--- a/dillorc2	Sun Oct 28 01:15:19 2007 +0200
+++ b/dillorc2	Mon Oct 29 15:51:30 2007 +0100
@@ -16,6 +16,9 @@
 # If you have a lot of memory and a slow CPU, use YES, otherwise use NO
 use_dicache=NO
 
+# Uncomment if you want to have text-only browsing from the start.
+# (there's a toggle button near the bug meter to change this on-the-fly)
+#load_images=NO
 
 #-------------------------------------------------------------------------
 #                           RENDERING SECTION
--- a/src/form.cc	Sun Oct 28 01:15:19 2007 +0200
+++ b/src/form.cc	Mon Oct 29 15:51:30 2007 +0100
@@ -95,4 +95,9 @@
    a_Html_form_event_handler(ext_data, this, (Resource*)resource);
 }
 
+void Form::activate (Resource *resource)
+{
+   a_Html_form_event_handler(ext_data, this, (Resource*)resource);
+}
+
 } // namespace form
--- a/src/form.hh	Sun Oct 28 01:15:19 2007 +0200
+++ b/src/form.hh	Mon Oct 29 15:51:30 2007 +0100
@@ -9,11 +9,12 @@
 /**
  * \brief Handles HTML form data.
  *
- * Add resources by calling the respective add...Resource method. Furtermore,
- * this class impelements dw::core::ui::ButtonResource::ClickedReceiver, the
- * form data is printed to stdout, when the "clicked" signal is received.
+ * Add resources by calling the respective add...Resource method. Furthermore,
+ * this class implements dw::core::ui::ButtonResource::ClickedReceiver and
+ * dw::core::ui::Resource::ActivateReceiver.
  */
-class Form: public dw::core::ui::ButtonResource::ClickedReceiver
+class Form: public dw::core::ui::ButtonResource::ClickedReceiver,
+            public dw::core::ui::Resource::ActivateReceiver
 {
 private:
    /**
@@ -79,6 +80,7 @@
    Form (void *p);
    ~Form ();
    void clicked (dw::core::ui::ButtonResource *resource, int buttonNo);
+   void activate (dw::core::ui::Resource *resource);
 
 };
 
--- a/src/html.cc	Sun Oct 28 01:15:19 2007 +0200
+++ b/src/html.cc	Mon Oct 29 15:51:30 2007 +0100
@@ -2483,7 +2483,6 @@
 
    textblock = DW2TB(html->dw);
 
-
    usemap_url = NULL;
    if ((attrbuf = Html_get_attr(html, tag, tagsize, "usemap")))
       /* todo: usemap URLs outside of the document are not used. */
@@ -3789,6 +3788,7 @@
        //HT2LT(html)->getResourceFactory()->createEntryResource (15, false);
          HT2LT(html)->getResourceFactory()->createEntryResource (10, false);
       widget = embed = new Embed (entryResource);
+      entryResource->connectActivate (form->form_receiver);
       init_str = (value) ? value : NULL;
    } else {
       /* Unknown input type */
--- a/src/menu.cc	Sun Oct 28 01:15:19 2007 +0200
+++ b/src/menu.cc	Mon Oct 29 15:51:30 2007 +0100
@@ -18,6 +18,7 @@
 #include <fltk/Item.h>
 #include <fltk/Divider.h>
 
+#include "msg.h"
 #include "menu.hh"
 #include "uicmd.hh"
 #include "history.h"
@@ -68,9 +69,27 @@
 
 
 //--------------------------------------------------------------------------
-static void Menu_link_cb(Widget* )
+static void Menu_unimplemented_cb(Widget*)
 {
-   printf("Menu_link_cb: click! :-)\n");
+   MSG("Menu_unimplemented_cb: click! :-)\n");
+}
+
+static void Menu_link_cb(Widget*, void *user_data)
+{
+   DilloUrl *url = (DilloUrl *) user_data ;
+   MSG("Menu_link_cb: click! :-)\n");
+
+   if (url)
+      a_Menu_link_popup(popup_bw, url);
+}
+
+/* 
+ * Open URL
+ */
+static void Menu_open_url_cb(Widget* )
+{
+   MSG("Open URL cb: click! :-)\n");
+   a_UIcmd_open_url(popup_bw, popup_url);
 }
 
 /* 
@@ -78,7 +97,7 @@
  */
 static void Menu_open_url_nw_cb(Widget* )
 {
-   printf("Open URL in new window cb: click! :-)\n");
+   MSG("Open URL in new window cb: click! :-)\n");
    a_UIcmd_open_url_nw(popup_bw, popup_url);
 }
 
@@ -185,7 +204,8 @@
 /*
  * Page popup menu (construction & popup)
  */
-void a_Menu_page_popup(BrowserWindow *bw, const 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;
@@ -251,7 +271,7 @@
        i = new Item("Bookmark this Link");
        i->callback(Menu_add_bookmark_cb);
        i = new Item("Copy Link location");
-       i->callback(Menu_link_cb);
+       i->callback(Menu_unimplemented_cb);
        i->deactivate();
        new Divider();    
        i = new Item("Save Link As...");
@@ -268,6 +288,58 @@
 }
 
 /*
+ * Image popup menu (construction & popup)
+ */
+void a_Menu_image_popup(BrowserWindow *bw, const DilloUrl *url,
+                        DilloUrl *link_url)
+{
+   // One menu for every browser window
+   static PopupMenu *pm = 0;
+   Widget *link_menuitem;
+
+   popup_bw = bw;
+   popup_url = url;
+   
+   if (!pm) {
+      Item *i;
+      pm = new PopupMenu(0,0,0,0,"&IMAGE OPTIONS");
+      pm->begin();
+       i = new Item("Isolate Image");                     // 0
+       i->callback(Menu_open_url_cb);
+       i = new Item("Open Image in New Window");          // 1
+       i->callback(Menu_open_url_nw_cb);
+       i = new Item("Bookmark this Image");               // 2
+       i->callback(Menu_add_bookmark_cb);
+       i = new Item("Copy Image location");               // 3
+       i->callback(Menu_unimplemented_cb);
+       i->deactivate();
+       new Divider();                                     // 4
+       i = new Item("Save Image As...");                  // 5
+       i->callback(Menu_save_link_cb);
+       new Divider();                                     // 6
+       i = new Item("Link menu");                         // 7
+       i->callback(Menu_link_cb);
+
+      pm->type(PopupMenu::POPUP123);
+      pm->end();
+   }
+
+   link_menuitem = pm->child(7);                          // 7
+
+   if (link_url) {
+      link_menuitem->user_data(link_url);
+      link_menuitem->activate();
+   } else {
+      link_menuitem->deactivate();
+   }
+ 
+   // Make the popup a child of the calling UI object
+   ((Group *)bw->ui)->add(pm);
+
+   pm->popup();
+}
+
+/*
  * Bugmeter popup menu (construction & popup)
  */
 void a_Menu_bugmeter_popup(BrowserWindow *bw, const DilloUrl *url)
--- a/src/menu.hh	Sun Oct 28 01:15:19 2007 +0200
+++ b/src/menu.hh	Mon Oct 29 15:51:30 2007 +0100
@@ -10,6 +10,8 @@
 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_image_popup(BrowserWindow *bw, const DilloUrl *url,
+                        DilloUrl *link_url);
 void a_Menu_bugmeter_popup(BrowserWindow *bw, const DilloUrl *url);
 void a_Menu_history_popup(BrowserWindow *bw, int direction);
 
--- a/src/pixmaps.h	Sun Oct 28 01:15:19 2007 +0200
+++ b/src/pixmaps.h	Mon Oct 29 15:51:30 2007 +0100
@@ -1495,6 +1495,48 @@
 };
 
 /* XPM */
+static char * imgload_on_xpm[] = {
+"15 15 2 1",
+"       c #00000000CF3C",
+".      c #FFFFFFFFFFFF",
+" . .  .........",
+" .     ...   ..",
+" .   . ... ....",
+" . ... .. .....",
+" .....  . ..  .",
+".........  .. .",
+"..........    .",
+"...............",
+".   ...........",
+". .  .  .. ....",
+". .. .     ....",
+". .. . .  .....",
+".    . .  .....",
+"...............",
+"..............."};
+
+/* XPM */
+static char * imgload_off_xpm[] = {
+"15 15 2 1",
+"       c #CF3C00000000",
+".      c #FFFFFFFFFFFF",
+" .. . .........",
+" .    ..    ...",
+" .     . ......",
+" . . . . ..  ..",
+" . ...    .. ..",
+" ........    ..",
+"...............",
+"...............",
+"...............",
+"    ..  .  ....",
+" .     ..    ..",
+" . . .... .....",
+"   .    .   ...",
+"  ..  ...   ...",
+".... .... ....."};
+
+/* XPM */
 static char *left_i_xpm[] = {
 "22 22 3 1",
 "  c None",
--- a/src/plain.cc	Sun Oct 28 01:15:19 2007 +0200
+++ b/src/plain.cc	Mon Oct 29 15:51:30 2007 +0100
@@ -33,12 +33,33 @@
 using namespace dw;
 using namespace dw::core;
 
+typedef struct _DilloPlainED DilloPlainED;
+
+struct _DilloPlainED {
+   class PlainEventReceiver: public dw::core::Widget::EventReceiver
+   {
+   private:
+      DilloPlainED *ed;
+
+   public:
+      inline PlainEventReceiver (DilloPlainED *ed) { this->ed = ed; }
+
+      bool buttonPress(dw::core::Widget *widget, dw::core::EventButton *event);
+   };
+
+   // Since DilloPlain is a struct, not a class, a simple
+   // "PlainEventReceiver eventReceiver" (see signal documentation) would not
+   // work, therefore the pointer.
+   PlainEventReceiver *eventReceiver;
+
+   BrowserWindow *bw;
+   DilloUrl *url;
+};
 
 typedef struct _DilloPlain {
-   //DwWidget *dw;
    Widget *dw;
+   DilloPlainED *eventdata;
    size_t Start_Ofs;    /* Offset of where to start reading next */
-   //DwStyle *style;
    style::Style *widgetStyle;
    BrowserWindow *bw;
    int state;
@@ -64,32 +85,52 @@
 static void Plain_write(DilloPlain *plain, void *Buf, uint_t BufSize, int Eof);
 static void Plain_callback(int Op, CacheClient_t *Client);
 
+/*
+ * Create the plain event-data structure (analog to linkblock in HTML).
+ */
+static DilloPlainED *Plain_ed_new(BrowserWindow *bw, const DilloUrl *url)
+{
+   DilloPlainED *plain_ed = dNew(DilloPlainED, 1);
 
+   plain_ed->eventReceiver = new DilloPlainED::PlainEventReceiver (plain_ed);
+   plain_ed->bw = bw;
+   plain_ed->url = a_Url_dup(url);
+
+   return plain_ed;
+}
 
 /*
- * Popup the page menu ("button_press_event" callback of the viewport)
+ * Free memory used by the eventdata structure
  */
-//static int Plain_page_menu(GtkWidget *viewport, GdkEventButton *event,
-//                         BrowserWindow *bw)
-//{
-//   if (event->button == 3) {
-//      a_Menu_popup_set_url(bw, a_History_get_url(NAV_TOP_UIDX(bw)));
-//      gtk_menu_popup(GTK_MENU(bw->menu_popup.over_page), NULL, NULL,
-//                     NULL, NULL, event->button, event->time);
-//      return TRUE;
-//   } else
-//      return FALSE;
-//}
+static void Plain_ed_free(void *ed)
+{
+   DilloPlainED *plain_ed = (DilloPlainED *)ed;
+
+   delete plain_ed->eventReceiver;
+   a_Url_free(plain_ed->url);
+
+   dFree(plain_ed);
+}
+
+/*
+ * Receive the mouse button press event
+ */
+bool DilloPlainED::PlainEventReceiver::buttonPress (Widget *widget,
+                                                    EventButton *event)
+{
+   if (event->button == 3) {
+      a_UIcmd_page_popup(ed->bw, ed->url, NULL);
+      return true;
+   }
+   return false;
+}
 
 /*
  * Create and initialize a new DilloPlain structure.
  */
-static DilloPlain *Plain_new(BrowserWindow *bw)
+static DilloPlain *Plain_new(BrowserWindow *bw, const DilloUrl *url)
 {
    DilloPlain *plain;
-   //DwPage *page;
-   //DwStyle style_attrs;
-   //DwStyleFont font_attrs;
    Textblock *textblock;
    style::StyleAttrs styleAttrs;
    style::FontAttrs fontAttrs;
@@ -98,28 +139,18 @@
    plain->state = ST_SeekingEol;
    plain->Start_Ofs = 0;
    plain->bw = bw;
-   //plain->dw = a_Dw_page_new();
-   //page = (DwPage *) plain->dw;
    textblock = new Textblock (false);
    plain->dw = (Widget*) textblock;
 
+   // BUG: event receiver is never freed.
+   plain->eventdata = Plain_ed_new(bw, url);
+
    /* Create the font and attribute for the page. */
-   //font_attrs.name = prefs.fw_fontname;
-   //font_attrs.size = rint(12.0 * prefs.font_factor);
-   //font_attrs.weight = 400;
-   //font_attrs.style = DW_STYLE_FONT_STYLE_NORMAL;
    fontAttrs.name = "Courier";
    fontAttrs.size = (int) rint(12.0 * prefs.font_factor);
    fontAttrs.weight = 400;
    fontAttrs.style = style::FONT_STYLE_NORMAL;
 
-   //a_Dw_style_init_values (&style_attrs);
-   //style_attrs.font =
-   //   a_Dw_style_font_new (plain->bw->render_layout, &font_attrs);
-   //style_attrs.color =
-   //   a_Dw_style_color_new (plain->bw->render_layout, prefs.text_color);
-   //plain->style = a_Dw_style_new (plain->bw->render_layout, &style_attrs);
-   //a_Dw_widget_set_style (plain->dw, plain->style);
    Layout *layout = (Layout*)bw->render_layout;
    styleAttrs.initValues ();
    styleAttrs.margin.setVal (5);
@@ -130,10 +161,7 @@
    plain->widgetStyle = style::Style::create (layout, &styleAttrs);
 
    /* The context menu */
-// gtk_signal_connect_while_alive
-//    (GTK_OBJECT(GTK_BIN(plain->bw->render_main_scroll)->child),
-//     "button_press_event", GTK_SIGNAL_FUNC(Plain_page_menu),
-//     plain->bw, GTK_OBJECT (page));
+   textblock->connectEvent (plain->eventdata->eventReceiver);
 
    return plain;
 }
@@ -144,7 +172,7 @@
 void *a_Plain_text(const char *type, void *P, CA_Callback_t *Call, void **Data)
 {
    DilloWeb *web = (DilloWeb*)P;
-   DilloPlain *plain = Plain_new(web->bw);
+   DilloPlain *plain = Plain_new(web->bw, web->url);
 
    *Call = (CA_Callback_t)Plain_callback;
    *Data = (void*)plain;
@@ -169,7 +197,6 @@
       /* set progress bar insensitive */
       a_UIcmd_set_page_prog(plain->bw, 0, 0);
 
-      //a_Dw_style_unref (plain->bw->render_layout, plain->style);
       plain->widgetStyle->unref();
       dFree(plain);
    } else {
@@ -185,7 +212,6 @@
  */
 static void Plain_write(DilloPlain *plain, void *Buf, uint_t BufSize, int Eof)
 {
-   //DwPage *page = (DwPage *)plain->dw;
    Textblock *textblock = (Textblock*)plain->dw;
    char *Start;
    char *data;
@@ -205,8 +231,6 @@
          break;
       case ST_Eol:
          data = dStrndup(Start + i - len, len);
-         //a_Dw_page_add_text(page, a_Misc_expand_tabs(data), plain->style);
-         //a_Dw_page_add_parbreak(page, 0, plain->style);
          textblock->addText(a_Misc_expand_tabs(data), plain->widgetStyle);
          textblock->addParbreak(0, plain->widgetStyle);
          dFree(data);
@@ -220,8 +244,6 @@
    plain->Start_Ofs += i - len;
    if (Eof && len) {
       data = dStrndup(Start + i - len, len);
-      //a_Dw_page_add_text(page, a_Misc_expand_tabs(data), plain->style);
-      //a_Dw_page_add_parbreak(page, 0, plain->style);
       textblock->addText(a_Misc_expand_tabs(data), plain->widgetStyle);
       textblock->addParbreak(0, plain->widgetStyle);
       dFree(data);
--- a/src/prefs.c	Sun Oct 28 01:15:19 2007 +0200
+++ b/src/prefs.c	Mon Oct 29 15:51:30 2007 +0100
@@ -63,6 +63,7 @@
    { "http_proxyuser", DRC_TOKEN_PROXYUSER },
    { "limit_text_width", DRC_TOKEN_LIMIT_TEXT_WIDTH },
    { "link_color", DRC_TOKEN_LINK_COLOR },
+   { "load_images", DRC_TOKEN_LOAD_IMAGES },
    { "no_proxy", DRC_TOKEN_NOPROXY },
    { "panel_size", DRC_TOKEN_PANEL_SIZE },
    { "search_url", DRC_TOKEN_SEARCH_URL },
@@ -282,6 +283,9 @@
    case DRC_TOKEN_FULLWINDOW_START:
       prefs.fullwindow_start = (strcmp(value, "YES") == 0);
       break;
+   case DRC_TOKEN_LOAD_IMAGES:
+      prefs.load_images = (strcmp(value, "YES") == 0);
+      break;
    case DRC_TOKEN_TRANSIENT_DIALOGS:
       prefs.transient_dialogs = (strcmp(value, "YES") == 0);
       break;
@@ -397,6 +401,7 @@
    prefs.show_search=TRUE;
    prefs.show_progress_box=TRUE;
    prefs.fullwindow_start=FALSE;
+   prefs.load_images=TRUE;
    prefs.transient_dialogs=FALSE;
    prefs.vw_fontname = dStrdup("helvetica");
    prefs.fw_fontname = dStrdup("courier");
--- a/src/prefs.h	Sun Oct 28 01:15:19 2007 +0200
+++ b/src/prefs.h	Mon Oct 29 15:51:30 2007 +0100
@@ -36,6 +36,7 @@
    DRC_TOKEN_HOME,
    DRC_TOKEN_LIMIT_TEXT_WIDTH,
    DRC_TOKEN_LINK_COLOR,
+   DRC_TOKEN_LOAD_IMAGES,
    DRC_TOKEN_NOPROXY,
    DRC_TOKEN_PANEL_SIZE,
    DRC_TOKEN_PROXY,
@@ -107,6 +108,7 @@
    bool_t show_search;
    bool_t show_progress_box;
    bool_t fullwindow_start;
+   bool_t load_images;
    bool_t transient_dialogs;
    char *vw_fontname;
    char *fw_fontname;
--- a/src/ui.cc	Sun Oct 28 01:15:19 2007 +0200
+++ b/src/ui.cc	Mon Oct 29 15:51:30 2007 +0100
@@ -307,6 +307,19 @@
 }
 
 /*
+ * Callback for the image loading button.
+ */
+void imageload_cb(Widget *w, void *data)
+{
+   int k = event_key();
+   if (k && k <= 7)
+      MSG("[ImageLoad], mouse button %d was pressed\n", k);
+   if (k == 1) {
+      ((UI*)data)->imageload_toggle();
+   }
+}
+
+/*
  * File menu item callback.
  */
 void menu_cb(Widget* w, void*)
@@ -610,8 +623,9 @@
      StatusPanel = new Group(0, win_h-s_h, win_w, s_h, 0);
      StatusPanel->begin();
       // Status box
+      int il_w = 16;
       int bm_w = 16;
-      Status = new Output(0, 0, win_w-bm_w, s_h, 0);
+      Status = new Output(0, 0, win_w-bm_w-il_w, s_h, 0);
       Status->value("");
       //Status->box(UP_BOX);
       Status->box(THIN_DOWN_BOX);
@@ -619,6 +633,20 @@
       Status->clear_tab_to_focus();
       //Status->throw_focus();
 
+      // Image loading indicator
+      ImageLoad = new HighlightButton(win_w-il_w-bm_w,0,il_w,s_h,0);
+      ImgImageLoadOn = new xpmImage(imgload_on_xpm);
+      ImgImageLoadOff = new xpmImage(imgload_off_xpm);
+      if (prefs.load_images) {
+         ImageLoad->image(ImgImageLoadOn);
+      } else {
+         ImageLoad->image(ImgImageLoadOff);
+      }
+      ImageLoad->box(THIN_DOWN_BOX);
+      ImageLoad->align(ALIGN_INSIDE|ALIGN_CLIP|ALIGN_LEFT);
+      ImageLoad->tooltip("Click me to toggle image loading.");
+      ImageLoad->callback(imageload_cb, (void *)this);
+
       // Bug Meter
       BugMeter = new HighlightButton(win_w-bm_w,0,bm_w,s_h,0);
       ImgMeterOK = new xpmImage(mini_ok_xpm);
@@ -764,7 +792,9 @@
       BugMeter->redraw_label();
       new_w = strlen(str)*8 + 20;
    }
-   Status->resize(0,0,StatusPanel->w()-new_w,Status->h());
+   Status->resize(0,0,StatusPanel->w()-ImageLoad->w()-new_w,Status->h());
+   ImageLoad->resize(StatusPanel->w()-ImageLoad->w()-new_w, 0, ImageLoad->w(),
+                     ImageLoad->h());
    BugMeter->resize(StatusPanel->w()-new_w, 0, new_w, BugMeter->h());
    StatusPanel->init_sizes();
 }
@@ -853,6 +883,19 @@
 }
 
 /*
+ * Toggle image loading
+ */
+void UI::imageload_toggle()
+{
+   prefs.load_images = !prefs.load_images;
+   if (prefs.load_images) {
+      ImageLoad->image(ImgImageLoadOn);
+   } else {
+      ImageLoad->image(ImgImageLoadOff);
+   }
+}
+
+/*
  * Set 'nw' as the main render area widget
  */
 void UI::set_render_layout(Widget &nw)
--- a/src/ui.hh	Sun Oct 28 01:15:19 2007 +0200
+++ b/src/ui.hh	Mon Oct 29 15:51:30 2007 +0100
@@ -34,12 +34,12 @@
 class UI : public fltk::Window {
    Group *TopGroup;
    Button *Back, *Forw, *Home, *Reload, *Save, *Stop, *Bookmarks,
-          *Clear, *Search, *FullScreen, *BugMeter;
+          *Clear, *Search, *FullScreen, *ImageLoad, *BugMeter;
    Input  *Location;
    Widget *PProg, *IProg;
    Image *ImgLeftIns, *ImgLeftSens, *ImgRightIns, *ImgRightSens,
          *ImgStopIns, *ImgStopSens, *ImgFullScreenOn, *ImgFullScreenOff,
-         *ImgMeterOK, *ImgMeterBug;
+         *ImgImageLoadOn, *ImgImageLoadOff, *ImgMeterOK, *ImgMeterBug;
    Group *Panel, *StatusPanel;
    Widget *Main;
    Output *Status;
@@ -104,6 +104,7 @@
    void color_change_cb_i();
    void toggle_cb_i();
    void fullscreen_cb_i();
+   void imageload_toggle();
 };
 
 #endif // __UI_HH__
--- a/src/uicmd.cc	Sun Oct 28 01:15:19 2007 +0200
+++ b/src/uicmd.cc	Mon Oct 29 15:51:30 2007 +0100
@@ -181,6 +181,14 @@
 /*
  * Open a new URL in the given browser window
  */
+void a_UIcmd_open_url(BrowserWindow *bw, const DilloUrl *url)
+{
+   a_Nav_push(bw, url);
+}
+
+/*
+ * Open a new URL in the given browser window
+ */
 void a_UIcmd_open_url_nw(BrowserWindow *bw, const DilloUrl *url)
 {
    a_Nav_push_nw(bw, url);
@@ -449,6 +457,14 @@
 }
 
 /*
+ * Pop up the image menu
+ */
+void a_UIcmd_image_popup(void *vbw, const DilloUrl *url, DilloUrl *link_url)
+{
+   a_Menu_image_popup((BrowserWindow*)vbw, url, link_url);
+}
+
+/*
  * Show a text window with the URL's source
  */
 void a_UIcmd_view_page_source(const DilloUrl *url)
--- a/src/uicmd.hh	Sun Oct 28 01:15:19 2007 +0200
+++ b/src/uicmd.hh	Mon Oct 29 15:51:30 2007 +0100
@@ -10,6 +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(BrowserWindow *bw, const 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);
@@ -28,6 +29,7 @@
 void a_UIcmd_fullscreen_toggle(BrowserWindow *bw);
 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_image_popup(void *vbw, const DilloUrl *url, DilloUrl *link_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);