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

Functions/Methods for commands triggered from the UI. More...

#include <string.h>
#include <stdio.h>
#include <stdarg.h>
#include <stdlib.h>
#include <math.h>
#include <limits.h>
#include <sys/stat.h>
#include <FL/Fl.H>
#include <FL/Fl_Widget.H>
#include <FL/Fl_Double_Window.H>
#include <FL/Fl_Wizard.H>
#include <FL/Fl_Box.H>
#include <FL/Fl_Pack.H>
#include <FL/Fl_Scroll.H>
#include <FL/names.h>
#include "paths.hh"
#include "keys.hh"
#include "ui.hh"
#include "uicmd.hh"
#include "timeout.hh"
#include "utf8.hh"
#include "menu.hh"
#include "dialog.hh"
#include "xembed.hh"
#include "bookmark.h"
#include "history.h"
#include "msg.h"
#include "prefs.h"
#include "misc.h"
#include "dlib/dlib.h"
#include "dw/fltkviewport.hh"
#include "nav.h"
Include dependency graph for uicmd.cc:

Go to the source code of this file.

Macros

#define DEFAULT_TAB_LABEL   "-.new.-"
 
#define BW2UI(bw)   ((UI*)((bw)->ui))
 

Functions

static BrowserWindowUIcmd_tab_new (CustTabs *tabs, UI *old_ui, int focus)
 
static void close_tab_btn_cb (Fl_Widget *, void *cb_data)
 Callback for the close-tab button.
 
static char * UIcmd_make_search_str (const char *str)
 
static void UIcmd_set_window_labels (Fl_Window *win, const char *str)
 
static int btn_cmp (const void *p1, const void *p2)
 
static void tab_btn_cb (Fl_Widget *w, void *cb_data)
 Callback for mouse click.
 
static void win_cb (Fl_Widget *w, void *cb_data)
 
BrowserWindowa_UIcmd_get_bw_by_widget (void *v_wid)
 
BrowserWindowa_UIcmd_browser_window_new (int ww, int wh, uint32_t xid, const void *vbw)
 
void a_UIcmd_close_bw (void *vbw)
 
void a_UIcmd_close_all_bw (void *)
 
static char * UIcmd_find_search_str (const char *str)
 
void a_UIcmd_open_urlstr (void *vbw, const char *urlstr)
 
void a_UIcmd_open_url (BrowserWindow *bw, const DilloUrl *url)
 
static void UIcmd_open_url_nbw (BrowserWindow *new_bw, const DilloUrl *url)
 
void a_UIcmd_open_url_nw (BrowserWindow *bw, const DilloUrl *url)
 
void a_UIcmd_open_url_nt (void *vbw, const DilloUrl *url, int focus)
 
void a_UIcmd_back (void *vbw)
 
void a_UIcmd_back_popup (void *vbw, int x, int y)
 
void a_UIcmd_forw (void *vbw)
 
void a_UIcmd_forw_popup (void *vbw, int x, int y)
 
void a_UIcmd_home (void *vbw)
 
void a_UIcmd_reload (void *vbw)
 
void a_UIcmd_reload_all_active ()
 
void a_UIcmd_repush (void *vbw)
 
void a_UIcmd_redirection0 (void *vbw, const DilloUrl *url)
 
void a_UIcmd_zoom_in (void *vbw)
 
void a_UIcmd_zoom_out (void *vbw)
 
void a_UIcmd_zoom_reset (void *vbw)
 
static char * UIcmd_make_save_filename (const DilloUrl *url)
 
void a_UIcmd_init (void)
 
static int UIcmd_save_file_check (const char *name)
 
static void UIcmd_save (BrowserWindow *bw, const DilloUrl *url, const char *title)
 
void a_UIcmd_save (void *vbw)
 
const char * a_UIcmd_select_file ()
 
void a_UIcmd_stop (void *vbw)
 
void a_UIcmd_tools (void *vbw, int x, int y)
 
void a_UIcmd_open_file (void *vbw)
 
void a_UIcmd_search_dialog (void *vbw)
 
const char * a_UIcmd_get_passwd (const char *user)
 
void a_UIcmd_save_link (BrowserWindow *bw, const DilloUrl *url)
 
void a_UIcmd_book (void *vbw)
 
void a_UIcmd_add_bookmark (BrowserWindow *bw, const DilloUrl *url)
 
void a_UIcmd_page_popup (void *vbw, bool_t has_bugs, void *v_cssUrls)
 
void a_UIcmd_link_popup (void *vbw, const DilloUrl *url)
 
void a_UIcmd_image_popup (void *vbw, const DilloUrl *url, bool_t loaded_img, DilloUrl *page_url, DilloUrl *link_url)
 
void a_UIcmd_form_popup (void *vbw, const DilloUrl *url, void *vform, bool_t showing_hiddens)
 
void a_UIcmd_file_popup (void *vbw, void *v_wid)
 
void a_UIcmd_copy_urlstr (BrowserWindow *bw, const char *urlstr)
 
void a_UIcmd_view_page_source (BrowserWindow *bw, 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)
 
void a_UIcmd_nav_jump (BrowserWindow *bw, int offset, int new_bw)
 
void a_UIcmd_get_wh (BrowserWindow *bw, int *w, int *h)
 
void a_UIcmd_get_scroll_xy (BrowserWindow *bw, int *x, int *y)
 
void a_UIcmd_set_scroll_xy (BrowserWindow *bw, int x, int y)
 
void a_UIcmd_set_scroll_by_fragment (BrowserWindow *bw, const char *f)
 
void a_UIcmd_scroll (BrowserWindow *bw, int icmd)
 
char * a_UIcmd_get_location_text (BrowserWindow *bw)
 
void a_UIcmd_set_location_text (void *vbw, const char *text)
 
void a_UIcmd_set_page_prog (BrowserWindow *bw, size_t nbytes, int cmd)
 
void a_UIcmd_set_img_prog (BrowserWindow *bw, int n_img, int t_img, int cmd)
 
void a_UIcmd_set_bug_prog (BrowserWindow *bw, int n_bug)
 
void a_UIcmd_set_page_title (BrowserWindow *bw, const char *label)
 
void a_UIcmd_set_msg (BrowserWindow *bw, const char *format,...)
 
void a_UIcmd_set_buttons_sens (BrowserWindow *bw)
 
void a_UIcmd_panels_toggle (BrowserWindow *bw)
 
void a_UIcmd_findtext_search (BrowserWindow *bw, const char *key, int case_sens, int backward)
 
void a_UIcmd_findtext_reset (BrowserWindow *bw)
 
void a_UIcmd_findbar_toggle (BrowserWindow *bw, int on)
 
void a_UIcmd_focus_main_area (BrowserWindow *bw)
 
void a_UIcmd_focus_location (void *vbw)
 

Variables

static const char * save_dir = ""
 
static struct Tabgroup * tabgroups = NULL
 

Detailed Description

Functions/Methods for commands triggered from the UI.

Definition in file uicmd.cc.

Macro Definition Documentation

◆ BW2UI

#define BW2UI (   bw)    ((UI*)((bw)->ui))

Definition at line 59 of file uicmd.cc.

◆ DEFAULT_TAB_LABEL

#define DEFAULT_TAB_LABEL   "-.new.-"

Definition at line 56 of file uicmd.cc.

Function Documentation

◆ a_UIcmd_add_bookmark()

void a_UIcmd_add_bookmark ( BrowserWindow bw,
const DilloUrl url 
)

Definition at line 1253 of file uicmd.cc.

References a_Bookmarks_add().

Referenced by Menu_add_bookmark_cb().

◆ a_UIcmd_back()

void a_UIcmd_back ( void *  vbw)

Definition at line 865 of file uicmd.cc.

References a_Nav_back().

Referenced by b1_cb(), and UI::handle().

◆ a_UIcmd_back_popup()

void a_UIcmd_back_popup ( void *  vbw,
int  x,
int  y 
)

Definition at line 873 of file uicmd.cc.

References a_Menu_history_popup().

Referenced by b1_cb().

◆ a_UIcmd_book()

void a_UIcmd_book ( void *  vbw)

Definition at line 1243 of file uicmd.cc.

References a_UIcmd_open_url(), a_Url_free(), and a_Url_new().

Referenced by b1_cb(), and UI::handle().

◆ a_UIcmd_browser_window_new()

BrowserWindow * a_UIcmd_browser_window_new ( int  ww,
int  wh,
uint32_t  xid,
const void *  vbw 
)

◆ a_UIcmd_bugmeter_popup()

void a_UIcmd_bugmeter_popup ( void *  vbw)

Definition at line 1364 of file uicmd.cc.

References a_History_get_url(), a_Menu_bugmeter_popup(), and NAV_TOP_UIDX.

Referenced by bugmeter_cb().

◆ a_UIcmd_close_all_bw()

void a_UIcmd_close_all_bw ( void *  p)

◆ a_UIcmd_close_bw()

◆ a_UIcmd_copy_urlstr()

void a_UIcmd_copy_urlstr ( BrowserWindow bw,
const char *  urlstr 
)

Definition at line 1306 of file uicmd.cc.

References dw::core::Layout::copySelection(), layout, and BrowserWindow::render_layout.

Referenced by Menu_copy_urlstr_cb().

◆ a_UIcmd_file_popup()

void a_UIcmd_file_popup ( void *  vbw,
void *  v_wid 
)

Definition at line 1298 of file uicmd.cc.

References a_Menu_file_popup().

Referenced by filemenu_cb(), and UI::handle().

◆ a_UIcmd_findbar_toggle()

void a_UIcmd_findbar_toggle ( BrowserWindow bw,
int  on 
)

Definition at line 1637 of file uicmd.cc.

References BW2UI.

Referenced by Findbar::hide_cb().

◆ a_UIcmd_findtext_reset()

void a_UIcmd_findtext_reset ( BrowserWindow bw)

◆ a_UIcmd_findtext_search()

void a_UIcmd_findtext_search ( BrowserWindow bw,
const char *  key,
int  case_sens,
int  backward 
)

◆ a_UIcmd_focus_location()

void a_UIcmd_focus_location ( void *  vbw)

Definition at line 1653 of file uicmd.cc.

References BW2UI.

Referenced by filemenu_cb().

◆ a_UIcmd_focus_main_area()

void a_UIcmd_focus_main_area ( BrowserWindow bw)

Definition at line 1645 of file uicmd.cc.

References BW2UI.

◆ a_UIcmd_form_popup()

void a_UIcmd_form_popup ( void *  vbw,
const DilloUrl url,
void *  vform,
bool_t  showing_hiddens 
)

Definition at line 1289 of file uicmd.cc.

References a_Menu_form_popup().

◆ a_UIcmd_forw()

void a_UIcmd_forw ( void *  vbw)

Definition at line 881 of file uicmd.cc.

References a_Nav_forw().

Referenced by b1_cb(), and UI::handle().

◆ a_UIcmd_forw_popup()

void a_UIcmd_forw_popup ( void *  vbw,
int  x,
int  y 
)

Definition at line 889 of file uicmd.cc.

References a_Menu_history_popup().

Referenced by b1_cb().

◆ a_UIcmd_get_bw_by_widget()

◆ a_UIcmd_get_history()

int * a_UIcmd_get_history ( BrowserWindow bw,
int  direction 
)

Definition at line 1375 of file uicmd.cc.

References a_Nav_stack_ptr(), a_Nav_stack_size(), dNew, and NAV_UIDX.

Referenced by a_Menu_history_popup().

◆ a_UIcmd_get_location_text()

char * a_UIcmd_get_location_text ( BrowserWindow bw)

Definition at line 1492 of file uicmd.cc.

References BW2UI, and dStrdup().

◆ a_UIcmd_get_passwd()

const char * a_UIcmd_get_passwd ( const char *  user)

Definition at line 1222 of file uicmd.cc.

References a_Dialog_passwd(), dFree(), and dStrconcat().

Referenced by main().

◆ a_UIcmd_get_scroll_xy()

void a_UIcmd_get_scroll_xy ( BrowserWindow bw,
int *  x,
int *  y 
)

◆ a_UIcmd_get_wh()

void a_UIcmd_get_wh ( BrowserWindow bw,
int *  w,
int *  h 
)

Definition at line 1409 of file uicmd.cc.

References _MSG, and BW2UI.

Referenced by a_UIcmd_open_url_nw().

◆ a_UIcmd_home()

void a_UIcmd_home ( void *  vbw)

Definition at line 897 of file uicmd.cc.

References a_UIcmd_open_url(), DilloPrefs::home, and prefs.

Referenced by b1_cb(), and UI::handle().

◆ a_UIcmd_image_popup()

void a_UIcmd_image_popup ( void *  vbw,
const DilloUrl url,
bool_t  loaded_img,
DilloUrl page_url,
DilloUrl link_url 
)

Definition at line 1280 of file uicmd.cc.

References a_Menu_image_popup().

Referenced by DilloHtml::HtmlLinkReceiver::press().

◆ a_UIcmd_init()

void a_UIcmd_init ( void  )

Definition at line 1037 of file uicmd.cc.

References dStrconcat(), dStrdup(), prefs, DilloPrefs::save_dir, and save_dir.

Referenced by main().

◆ a_UIcmd_link_popup()

void a_UIcmd_link_popup ( void *  vbw,
const DilloUrl url 
)

Definition at line 1272 of file uicmd.cc.

References a_Menu_link_popup().

Referenced by DilloHtml::HtmlLinkReceiver::press().

◆ a_UIcmd_nav_jump()

void a_UIcmd_nav_jump ( BrowserWindow bw,
int  offset,
int  new_bw 
)

Definition at line 1399 of file uicmd.cc.

References a_Nav_jump().

Referenced by Menu_history_cb().

◆ a_UIcmd_open_file()

void a_UIcmd_open_file ( void *  vbw)

Definition at line 1153 of file uicmd.cc.

References a_Dialog_open_file(), a_UIcmd_open_url(), a_Url_free(), a_Url_new(), and dFree().

Referenced by filemenu_cb(), and UI::handle().

◆ a_UIcmd_open_url()

◆ a_UIcmd_open_url_nt()

void a_UIcmd_open_url_nt ( void *  vbw,
const DilloUrl url,
int  focus 
)

◆ a_UIcmd_open_url_nw()

◆ a_UIcmd_open_urlstr()

◆ a_UIcmd_page_popup()

void a_UIcmd_page_popup ( void *  vbw,
bool_t  has_bugs,
void *  v_cssUrls 
)

Definition at line 1262 of file uicmd.cc.

References a_History_get_url(), a_Menu_page_popup(), and NAV_TOP_UIDX.

Referenced by DilloHtml::HtmlLinkReceiver::press().

◆ a_UIcmd_panels_toggle()

void a_UIcmd_panels_toggle ( BrowserWindow bw)

Definition at line 1596 of file uicmd.cc.

References BW2UI.

◆ a_UIcmd_redirection0()

void a_UIcmd_redirection0 ( void *  vbw,
const DilloUrl url 
)

Definition at line 934 of file uicmd.cc.

References a_Nav_redirection0().

Referenced by Html_tag_open_meta().

◆ a_UIcmd_reload()

void a_UIcmd_reload ( void *  vbw)

Definition at line 905 of file uicmd.cc.

References a_Nav_reload().

Referenced by a_UIcmd_reload_all_active(), b1_cb(), and UI::handle().

◆ a_UIcmd_reload_all_active()

void a_UIcmd_reload_all_active ( )

Definition at line 913 of file uicmd.cc.

References a_UIcmd_get_bw_by_widget(), a_UIcmd_reload(), and tabgroups.

Referenced by main().

◆ a_UIcmd_repush()

void a_UIcmd_repush ( void *  vbw)

◆ a_UIcmd_save()

void a_UIcmd_save ( void *  vbw)

Definition at line 1110 of file uicmd.cc.

References a_History_get_url(), NAV_TOP_UIDX, and UIcmd_save().

Referenced by b1_cb(), UI::handle(), and Menu_save_page_cb().

◆ a_UIcmd_save_link()

void a_UIcmd_save_link ( BrowserWindow bw,
const DilloUrl url 
)

Definition at line 1235 of file uicmd.cc.

References UIcmd_save().

Referenced by Cache_savelink_cb(), and Menu_save_link_cb().

◆ a_UIcmd_scroll()

◆ a_UIcmd_search_dialog()

void a_UIcmd_search_dialog ( void *  vbw)

Definition at line 1208 of file uicmd.cc.

References a_Dialog_input(), a_UIcmd_open_urlstr(), dFree(), and UIcmd_make_search_str().

Referenced by UI::handle(), and search_cb().

◆ a_UIcmd_select_file()

const char * a_UIcmd_select_file ( void  )

Definition at line 1123 of file uicmd.cc.

References a_Dialog_select_file().

◆ a_UIcmd_set_bug_prog()

void a_UIcmd_set_bug_prog ( BrowserWindow bw,
int  n_bug 
)

Definition at line 1531 of file uicmd.cc.

References BW2UI.

Referenced by a_Web_dispatch_by_type(), and DilloHtml::bugMessage().

◆ a_UIcmd_set_buttons_sens()

◆ a_UIcmd_set_img_prog()

void a_UIcmd_set_img_prog ( BrowserWindow bw,
int  n_img,
int  t_img,
int  cmd 
)

Definition at line 1519 of file uicmd.cc.

References a_UIcmd_close_bw(), and BW2UI.

Referenced by a_Bw_add_client(), a_Bw_close_client(), and a_Web_dispatch_by_type().

◆ a_UIcmd_set_location_text()

void a_UIcmd_set_location_text ( void *  vbw,
const char *  text 
)

Definition at line 1500 of file uicmd.cc.

References BW2UI.

Referenced by a_Nav_push(), a_Web_dispatch_by_type(), main(), and UIcmd_open_url_nbw().

◆ a_UIcmd_set_msg()

◆ a_UIcmd_set_page_prog()

void a_UIcmd_set_page_prog ( BrowserWindow bw,
size_t  nbytes,
int  cmd 
)

Definition at line 1510 of file uicmd.cc.

References BW2UI.

Referenced by a_Web_dispatch_by_type(), and Cache_process_queue().

◆ a_UIcmd_set_page_title()

void a_UIcmd_set_page_title ( BrowserWindow bw,
const char *  label 
)

◆ a_UIcmd_set_scroll_by_fragment()

void a_UIcmd_set_scroll_by_fragment ( BrowserWindow bw,
const char *  f 
)

Definition at line 1444 of file uicmd.cc.

References layout, BrowserWindow::render_layout, and dw::core::Layout::setAnchor().

Referenced by a_Nav_expect_done().

◆ a_UIcmd_set_scroll_xy()

void a_UIcmd_set_scroll_xy ( BrowserWindow bw,
int  x,
int  y 
)

◆ a_UIcmd_stop()

void a_UIcmd_stop ( void *  vbw)

Definition at line 1132 of file uicmd.cc.

References a_Bw_stop_clients(), a_Nav_cancel_expect(), a_UIcmd_set_buttons_sens(), BW_Force, BW_Img, BW_Root, and MSG.

Referenced by b1_cb(), and UI::handle().

◆ a_UIcmd_tools()

void a_UIcmd_tools ( void *  vbw,
int  x,
int  y 
)

Definition at line 1145 of file uicmd.cc.

References a_Menu_tools_popup().

Referenced by b1_cb().

◆ a_UIcmd_view_page_bugs()

void a_UIcmd_view_page_bugs ( void *  vbw)

◆ a_UIcmd_view_page_source()

◆ a_UIcmd_zoom_in()

void a_UIcmd_zoom_in ( void *  vbw)

Definition at line 942 of file uicmd.cc.

References a_Nav_repush(), a_UIcmd_set_msg(), and BrowserWindow::zoom.

Referenced by UI::handle().

◆ a_UIcmd_zoom_out()

void a_UIcmd_zoom_out ( void *  vbw)

Definition at line 958 of file uicmd.cc.

References a_Nav_repush(), a_UIcmd_set_msg(), and BrowserWindow::zoom.

Referenced by UI::handle().

◆ a_UIcmd_zoom_reset()

void a_UIcmd_zoom_reset ( void *  vbw)

Definition at line 974 of file uicmd.cc.

References a_Nav_repush(), a_UIcmd_set_msg(), and BrowserWindow::zoom.

Referenced by UI::handle().

◆ btn_cmp()

static int btn_cmp ( const void *  p1,
const void *  p2 
)
static

Definition at line 111 of file uicmd.cc.

◆ close_tab_btn_cb()

static void close_tab_btn_cb ( Fl_Widget *  w,
void *  cb_data 
)
static

Callback for the close-tab button.

Definition at line 218 of file uicmd.cc.

References a_UIcmd_close_bw(), and a_UIcmd_get_bw_by_widget().

◆ tab_btn_cb()

static void tab_btn_cb ( Fl_Widget *  w,
void *  cb_data 
)
static

Callback for mouse click.

Definition at line 200 of file uicmd.cc.

References a_UIcmd_close_bw(), a_UIcmd_get_bw_by_widget(), prefs, and DilloPrefs::right_click_closes_tab.

◆ UIcmd_find_search_str()

static char * UIcmd_find_search_str ( const char *  str)
static

◆ UIcmd_make_save_filename()

static char * UIcmd_make_save_filename ( const DilloUrl url)
static

Definition at line 987 of file uicmd.cc.

References dFree(), dStrconcat(), dStrndup(), path(), save_dir, URL_PATH, and URL_QUERY.

Referenced by UIcmd_save().

◆ UIcmd_make_search_str()

◆ UIcmd_open_url_nbw()

static void UIcmd_open_url_nbw ( BrowserWindow new_bw,
const DilloUrl url 
)
static

◆ UIcmd_save()

static void UIcmd_save ( BrowserWindow bw,
const DilloUrl url,
const char *  title 
)
static

◆ UIcmd_save_file_check()

static int UIcmd_save_file_check ( const char *  name)
static

Definition at line 1053 of file uicmd.cc.

References a_Dialog_choice(), dStr_free(), dStr_sized_new(), dStr_sprintf(), and Dstr::str.

Referenced by UIcmd_save().

◆ UIcmd_set_window_labels()

static void UIcmd_set_window_labels ( Fl_Window *  win,
const char *  str 
)
static

Definition at line 613 of file uicmd.cc.

Referenced by a_UIcmd_set_page_title(), and UIcmd_tab_new().

◆ UIcmd_tab_new()

◆ win_cb()

static void win_cb ( Fl_Widget *  w,
void *  cb_data 
)
static

Variable Documentation

◆ save_dir

const char* save_dir = ""
static

Definition at line 70 of file uicmd.cc.

Referenced by a_UIcmd_init(), and UIcmd_make_save_filename().

◆ tabgroups

struct Tabgroup* tabgroups = NULL
static