Dillo v3.1.1-98-g318d1f14
Loading...
Searching...
No Matches
menu.cc File Reference

Functions for menus. More...

#include <FL/Fl.H>
#include <FL/Fl_Menu_Item.H>
#include "lout/misc.hh"
#include "msg.h"
#include "menu.hh"
#include "uicmd.hh"
#include "history.h"
#include "html.hh"
#include "ui.hh"
#include "keys.hh"
#include "timeout.hh"
Include dependency graph for menu.cc:

Go to the source code of this file.

Functions

static void Menu_nop_cb (Fl_Widget *, void *)
 
static void filemenu_cb (Fl_Widget *, void *data)
 Static function for File menu callbacks.
 
static void Menu_copy_urlstr_cb (Fl_Widget *, void *user_data)
 
static void Menu_open_url_cb (Fl_Widget *, void *user_data)
 Open URL.
 
static void Menu_open_url_nw_cb (Fl_Widget *, void *user_data)
 Open URL in new window.
 
static void Menu_open_url_nt_cb (Fl_Widget *, void *user_data)
 Open URL in new Tab.
 
static void Menu_add_bookmark_cb (Fl_Widget *, void *user_data)
 Add bookmark.
 
static void Menu_find_text_cb (Fl_Widget *, void *)
 Find text.
 
static void Menu_save_link_cb (Fl_Widget *, void *user_data)
 Save link.
 
static void Menu_save_page_cb (Fl_Widget *, void *)
 Save current page.
 
static void Menu_view_page_source_cb (Fl_Widget *, void *user_data)
 View current page source.
 
static void Menu_view_page_bugs_cb (Fl_Widget *, void *)
 View current page's bugs.
 
static void Menu_load_images_cb (Fl_Widget *, void *user_data)
 Load images on current page that match URL pattern.
 
static void Menu_form_submit_cb (Fl_Widget *, void *)
 Submit form.
 
static void Menu_form_reset_cb (Fl_Widget *, void *)
 Reset form.
 
static void Menu_form_hiddens_cb (Fl_Widget *, void *user_data)
 Toggle display of 'hidden' form controls.
 
static void Menu_stylesheet_cb (Fl_Widget *, void *vUrl)
 
static void Menu_bugmeter_validate (const char *validator_url)
 
static void Menu_bugmeter_validate_w3c_nu_cb (Fl_Widget *, void *)
 Validate URL with the W3C Nu validator (for HTML 5)
 
static void Menu_bugmeter_validate_w3c_cb (Fl_Widget *, void *)
 Validate URL with the W3C legacy validator (HTML 4.01 and older)
 
static void Menu_bugmeter_about_cb (Fl_Widget *, void *)
 Show info page for the bug meter.
 
static void Menu_history_cb (Fl_Widget *, void *data)
 Navigation History callback.
 
static void Menu_simple_popup_cb (void *data)
 
static void Menu_popup_cb (void *data)
 
void a_Menu_page_popup (BrowserWindow *bw, const DilloUrl *url, bool_t has_bugs, void *v_cssUrls)
 Page popup menu (construction & popup)
 
static void Menu_set_link_menu_user_data (void *user_data)
 
void a_Menu_link_popup (BrowserWindow *bw, const DilloUrl *url)
 Link popup menu (construction & popup)
 
void a_Menu_image_popup (BrowserWindow *bw, const DilloUrl *url, bool_t loaded_img, DilloUrl *page_url, DilloUrl *link_url)
 Image popup menu (construction & popup)
 
void a_Menu_form_popup (BrowserWindow *bw, const DilloUrl *page_url, void *formptr, bool_t hidvis)
 Form popup menu (construction & popup)
 
void a_Menu_file_popup (BrowserWindow *bw, void *v_wid)
 File popup menu (construction & popup)
 
void a_Menu_bugmeter_popup (BrowserWindow *bw, const DilloUrl *url)
 Bugmeter popup menu (construction & popup)
 
void a_Menu_history_popup (BrowserWindow *bw, int x, int y, int direction)
 Navigation History popup menu (construction & popup).
 
static void Menu_remote_css_cb (Fl_Widget *wid, void *)
 Toggle use of remote stylesheets.
 
static void Menu_embedded_css_cb (Fl_Widget *wid, void *)
 Toggle use of embedded CSS style.
 
static void Menu_force_https_cb (Fl_Widget *wid, void *)
 Toggle use of force https mode.
 
static void Menu_panel_change_cb (Fl_Widget *, void *user_data)
 
static void Menu_imgload_toggle_cb (Fl_Widget *wid, void *)
 Toggle loading of images – and load them if enabling.
 
static void Menu_bgimg_load_toggle_cb (Fl_Widget *wid, void *)
 Toggle loading of background images.
 
void a_Menu_tools_popup (BrowserWindow *bw, int x, int y)
 Tools popup menu (construction & popup).
 

Variables

static DilloUrlpopup_url = NULL
 
static BrowserWindowpopup_bw = NULL
 
static void * popup_form = NULL
 
static int popup_x
 
static int popup_y
 
static int history_direction = -1
 
static int * history_list = NULL
 
static Fl_Menu_Item link_menu []
 

Detailed Description

Functions for menus.

Definition in file menu.cc.

Function Documentation

◆ a_Menu_bugmeter_popup()

void a_Menu_bugmeter_popup ( BrowserWindow bw,
const DilloUrl url 
)

◆ a_Menu_file_popup()

void a_Menu_file_popup ( BrowserWindow bw,
void *  v_wid 
)

◆ a_Menu_form_popup()

void a_Menu_form_popup ( BrowserWindow bw,
const DilloUrl page_url,
void *  formptr,
bool_t  hidvis 
)

Form popup menu (construction & popup)

Definition at line 531 of file menu.cc.

References a_Timeout_add(), a_Url_dup(), a_Url_free(), Menu_form_hiddens_cb(), Menu_form_reset_cb(), Menu_form_submit_cb(), Menu_popup_cb(), popup_bw, popup_form, popup_url, popup_x, and popup_y.

Referenced by a_UIcmd_form_popup().

◆ a_Menu_history_popup()

void a_Menu_history_popup ( BrowserWindow bw,
int  x,
int  y,
int  direction 
)

Navigation History popup menu (construction & popup).

direction: {backward = -1, forward = 1}

Definition at line 618 of file menu.cc.

References a_History_get_title(), a_Timeout_add(), a_UIcmd_get_history(), dFree(), history_direction, history_list, INT2VOIDP, Menu_history_cb(), Menu_simple_popup_cb(), popup_bw, popup_x, and popup_y.

Referenced by a_UIcmd_back_popup(), and a_UIcmd_forw_popup().

◆ a_Menu_image_popup()

void a_Menu_image_popup ( BrowserWindow bw,
const DilloUrl url,
bool_t  loaded_img,
DilloUrl page_url,
DilloUrl link_url 
)

◆ a_Menu_link_popup()

void a_Menu_link_popup ( BrowserWindow bw,
const DilloUrl url 
)

Link popup menu (construction & popup)

Definition at line 454 of file menu.cc.

References a_Timeout_add(), a_Url_dup(), a_Url_free(), link_menu, Menu_popup_cb(), Menu_set_link_menu_user_data(), popup_bw, popup_url, popup_x, and popup_y.

Referenced by a_UIcmd_link_popup().

◆ a_Menu_page_popup()

◆ a_Menu_tools_popup()

◆ filemenu_cb()

static void filemenu_cb ( Fl_Widget *  ,
void *  data 
)
static

◆ Menu_add_bookmark_cb()

static void Menu_add_bookmark_cb ( Fl_Widget *  ,
void *  user_data 
)
static

Add bookmark.

Definition at line 127 of file menu.cc.

References a_UIcmd_add_bookmark(), and popup_bw.

Referenced by a_Menu_image_popup(), and a_Menu_page_popup().

◆ Menu_bgimg_load_toggle_cb()

static void Menu_bgimg_load_toggle_cb ( Fl_Widget *  wid,
void *   
)
static

Toggle loading of background images.

Definition at line 719 of file menu.cc.

References a_UIcmd_repush(), DilloPrefs::load_background_images, popup_bw, and prefs.

Referenced by a_Menu_tools_popup().

◆ Menu_bugmeter_about_cb()

static void Menu_bugmeter_about_cb ( Fl_Widget *  ,
void *   
)
static

Show info page for the bug meter.

Definition at line 285 of file menu.cc.

References a_UIcmd_open_urlstr(), and popup_bw.

Referenced by a_Menu_bugmeter_popup().

◆ Menu_bugmeter_validate()

static void Menu_bugmeter_validate ( const char *  validator_url)
static

◆ Menu_bugmeter_validate_w3c_cb()

static void Menu_bugmeter_validate_w3c_cb ( Fl_Widget *  ,
void *   
)
static

Validate URL with the W3C legacy validator (HTML 4.01 and older)

Definition at line 273 of file menu.cc.

References Menu_bugmeter_validate().

Referenced by a_Menu_bugmeter_popup().

◆ Menu_bugmeter_validate_w3c_nu_cb()

static void Menu_bugmeter_validate_w3c_nu_cb ( Fl_Widget *  ,
void *   
)
static

Validate URL with the W3C Nu validator (for HTML 5)

Definition at line 261 of file menu.cc.

References Menu_bugmeter_validate().

Referenced by a_Menu_bugmeter_popup().

◆ Menu_copy_urlstr_cb()

static void Menu_copy_urlstr_cb ( Fl_Widget *  ,
void *  user_data 
)
static

Definition at line 85 of file menu.cc.

References a_UIcmd_copy_urlstr(), popup_bw, and URL_STR.

Referenced by a_Menu_image_popup().

◆ Menu_embedded_css_cb()

static void Menu_embedded_css_cb ( Fl_Widget *  wid,
void *   
)
static

Toggle use of embedded CSS style.

Definition at line 665 of file menu.cc.

References a_UIcmd_repush(), DilloPrefs::parse_embedded_css, popup_bw, and prefs.

Referenced by a_Menu_tools_popup().

◆ Menu_find_text_cb()

static void Menu_find_text_cb ( Fl_Widget *  ,
void *   
)
static

Find text.

Definition at line 136 of file menu.cc.

References popup_bw, and BrowserWindow::ui.

Referenced by a_Menu_page_popup().

◆ Menu_force_https_cb()

static void Menu_force_https_cb ( Fl_Widget *  wid,
void *   
)
static

Toggle use of force https mode.

Definition at line 678 of file menu.cc.

References a_UIcmd_repush(), DilloPrefs::http_force_https, popup_bw, and prefs.

Referenced by a_Menu_tools_popup().

◆ Menu_form_hiddens_cb()

static void Menu_form_hiddens_cb ( Fl_Widget *  ,
void *  user_data 
)
static

Toggle display of 'hidden' form controls.

Definition at line 212 of file menu.cc.

References a_Bw_get_url_doc(), a_Html_form_display_hiddens(), popup_bw, popup_form, and popup_url.

Referenced by a_Menu_form_popup().

◆ Menu_form_reset_cb()

static void Menu_form_reset_cb ( Fl_Widget *  ,
void *   
)
static

Reset form.

Definition at line 201 of file menu.cc.

References a_Bw_get_url_doc(), a_Html_form_reset(), popup_bw, popup_form, and popup_url.

Referenced by a_Menu_form_popup().

◆ Menu_form_submit_cb()

static void Menu_form_submit_cb ( Fl_Widget *  ,
void *   
)
static

Submit form.

Definition at line 190 of file menu.cc.

References a_Bw_get_url_doc(), a_Html_form_submit(), popup_bw, popup_form, and popup_url.

Referenced by a_Menu_form_popup().

◆ Menu_history_cb()

static void Menu_history_cb ( Fl_Widget *  ,
void *  data 
)
static

◆ Menu_imgload_toggle_cb()

static void Menu_imgload_toggle_cb ( Fl_Widget *  wid,
void *   
)
static

Toggle loading of images – and load them if enabling.

Definition at line 700 of file menu.cc.

References a_Bw_get_current_doc(), a_Html_load_images(), DilloPrefs::load_images, popup_bw, and prefs.

Referenced by a_Menu_tools_popup().

◆ Menu_load_images_cb()

static void Menu_load_images_cb ( Fl_Widget *  ,
void *  user_data 
)
static

Load images on current page that match URL pattern.

Definition at line 178 of file menu.cc.

References a_Bw_get_url_doc(), a_Html_load_images(), popup_bw, and popup_url.

Referenced by a_Menu_image_popup().

◆ Menu_nop_cb()

static void Menu_nop_cb ( Fl_Widget *  ,
void *   
)
static

Definition at line 60 of file menu.cc.

Referenced by a_Menu_image_popup(), a_Menu_page_popup(), and a_Menu_tools_popup().

◆ Menu_open_url_cb()

static void Menu_open_url_cb ( Fl_Widget *  ,
void *  user_data 
)
static

Open URL.

Definition at line 96 of file menu.cc.

References _MSG, a_UIcmd_open_url(), and popup_bw.

Referenced by a_Menu_image_popup().

◆ Menu_open_url_nt_cb()

static void Menu_open_url_nt_cb ( Fl_Widget *  ,
void *  user_data 
)
static

Open URL in new Tab.

Definition at line 116 of file menu.cc.

References a_UIcmd_open_url_nt(), DilloPrefs::focus_new_tab, popup_bw, and prefs.

Referenced by a_Menu_image_popup().

◆ Menu_open_url_nw_cb()

static void Menu_open_url_nw_cb ( Fl_Widget *  ,
void *  user_data 
)
static

Open URL in new window.

Definition at line 106 of file menu.cc.

References _MSG, a_UIcmd_open_url_nw(), and popup_bw.

Referenced by a_Menu_image_popup().

◆ Menu_panel_change_cb()

static void Menu_panel_change_cb ( Fl_Widget *  ,
void *  user_data 
)
static

◆ Menu_popup_cb()

static void Menu_popup_cb ( void *  data)
static

◆ Menu_remote_css_cb()

static void Menu_remote_css_cb ( Fl_Widget *  wid,
void *   
)
static

Toggle use of remote stylesheets.

Definition at line 653 of file menu.cc.

References a_UIcmd_repush(), DilloPrefs::load_stylesheets, popup_bw, and prefs.

Referenced by a_Menu_tools_popup().

◆ Menu_save_link_cb()

static void Menu_save_link_cb ( Fl_Widget *  ,
void *  user_data 
)
static

Save link.

Definition at line 144 of file menu.cc.

References a_UIcmd_save_link(), and popup_bw.

Referenced by a_Menu_image_popup().

◆ Menu_save_page_cb()

static void Menu_save_page_cb ( Fl_Widget *  ,
void *   
)
static

Save current page.

Definition at line 153 of file menu.cc.

References a_UIcmd_save(), and popup_bw.

Referenced by a_Menu_page_popup().

◆ Menu_set_link_menu_user_data()

static void Menu_set_link_menu_user_data ( void *  user_data)
static

Definition at line 443 of file menu.cc.

References link_menu.

Referenced by a_Menu_image_popup(), and a_Menu_link_popup().

◆ Menu_simple_popup_cb()

static void Menu_simple_popup_cb ( void *  data)
static

◆ Menu_stylesheet_cb()

static void Menu_stylesheet_cb ( Fl_Widget *  ,
void *  vUrl 
)
static

◆ Menu_view_page_bugs_cb()

static void Menu_view_page_bugs_cb ( Fl_Widget *  ,
void *   
)
static

View current page's bugs.

Definition at line 170 of file menu.cc.

References a_UIcmd_view_page_bugs(), and popup_bw.

Referenced by a_Menu_page_popup().

◆ Menu_view_page_source_cb()

static void Menu_view_page_source_cb ( Fl_Widget *  ,
void *  user_data 
)
static

View current page source.

Definition at line 161 of file menu.cc.

References a_UIcmd_view_page_source(), and popup_bw.

Referenced by a_Menu_page_popup().

Variable Documentation

◆ history_direction

int history_direction = -1
static

Definition at line 54 of file menu.cc.

Referenced by a_Menu_history_popup(), and Menu_history_cb().

◆ history_list

int* history_list = NULL
static

Definition at line 56 of file menu.cc.

Referenced by a_Menu_history_popup(), and Menu_history_cb().

◆ link_menu

Fl_Menu_Item link_menu[]
static
Initial value:
= {
{"Open link in new tab", 0, Menu_open_url_nt_cb,0,0,0,0,0,0},
{"Open link in new window", 0, Menu_open_url_nw_cb,0,FL_MENU_DIVIDER,0,0,
0,0},
{"Bookmark this link", 0, Menu_add_bookmark_cb,0,0,0,0,0,0},
{"Copy link location", 0, Menu_copy_urlstr_cb,0,FL_MENU_DIVIDER,0,0,0,0},
{"Save link as...", 0, Menu_save_link_cb,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0}
}
static void Menu_copy_urlstr_cb(Fl_Widget *, void *user_data)
Definition menu.cc:85
static void Menu_add_bookmark_cb(Fl_Widget *, void *user_data)
Add bookmark.
Definition menu.cc:127
static void Menu_open_url_nw_cb(Fl_Widget *, void *user_data)
Open URL in new window.
Definition menu.cc:106
static void Menu_save_link_cb(Fl_Widget *, void *user_data)
Save link.
Definition menu.cc:144
static void Menu_open_url_nt_cb(Fl_Widget *, void *user_data)
Open URL in new Tab.
Definition menu.cc:116

Definition at line 433 of file menu.cc.

Referenced by a_Menu_image_popup(), a_Menu_link_popup(), and Menu_set_link_menu_user_data().

◆ popup_bw

◆ popup_form

void* popup_form = NULL
static

◆ popup_url

◆ popup_x

◆ popup_y