diff options
author | Johannes Hofmann <Johannes.Hofmann@gmx.de> | 2009-05-18 17:52:45 +0200 |
---|---|---|
committer | Johannes Hofmann <Johannes.Hofmann@gmx.de> | 2009-05-18 17:52:45 +0200 |
commit | 2ea9718c0a3297ff91c1219b3e011a8a3367461f (patch) | |
tree | 64ea43d63fa8f91dd3080e26475204ddb11fab04 /src | |
parent | e949bbc7ed966ed47bebba5798756501bd285917 (diff) |
add support for --xid command line option
The --xid option is used by a plugin for the claws mail client
(http://www.claws-mail.org/) to embed the dillo window into the mailer
application to display HTML mails.
Diffstat (limited to 'src')
-rw-r--r-- | src/Makefile.am | 4 | ||||
-rw-r--r-- | src/dillo.cc | 2 | ||||
-rw-r--r-- | src/menu.cc | 2 | ||||
-rw-r--r-- | src/nav.c | 2 | ||||
-rw-r--r-- | src/ui.cc | 2 | ||||
-rw-r--r-- | src/uicmd.cc | 11 | ||||
-rw-r--r-- | src/uicmd.hh | 2 |
7 files changed, 16 insertions, 9 deletions
diff --git a/src/Makefile.am b/src/Makefile.am index e71c4aa9..84af3202 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -108,6 +108,8 @@ dillo_SOURCES = \ dpiapi.h \ pixmaps.h \ findbar.cc \ - findbar.hh + findbar.hh \ + xembed.cc \ + xembed.hh EXTRA_DIST = chg srch diff --git a/src/dillo.cc b/src/dillo.cc index e80ab50b..6a3b938b 100644 --- a/src/dillo.cc +++ b/src/dillo.cc @@ -314,7 +314,7 @@ int main(int argc, char **argv) } // Create a new UI/bw pair - BrowserWindow *bw = a_UIcmd_browser_window_new(0, 0, NULL); + BrowserWindow *bw = a_UIcmd_browser_window_new(0, 0, xid, NULL); /* Proxy authentication */ if (prefs.http_proxyuser && !a_Http_proxy_auth()) { diff --git a/src/menu.cc b/src/menu.cc index ba650268..6ce67848 100644 --- a/src/menu.cc +++ b/src/menu.cc @@ -86,7 +86,7 @@ static void filemenu_cb(Widget *wid, void *data) { if (strcmp((char*)data, "nw") == 0) { UI *ui = (UI*)popup_bw->ui; - a_UIcmd_browser_window_new(ui->w(), ui->h(), popup_bw); + a_UIcmd_browser_window_new(ui->w(), ui->h(), 0, popup_bw); } else if (strcmp((char*)data, "nt") == 0) { a_UIcmd_open_url_nt(popup_bw, NULL, 1); } else if (strcmp((char*)data, "of") == 0) { @@ -431,7 +431,7 @@ void a_Nav_push_nw(BrowserWindow *bw, const DilloUrl *url) BrowserWindow *newbw; a_UIcmd_get_wh(bw, &w, &h); - newbw = a_UIcmd_browser_window_new(w, h, bw); + newbw = a_UIcmd_browser_window_new(w, h, 0, bw); a_Nav_push(newbw, url); } @@ -780,7 +780,7 @@ int UI::handle(int event) set_panelmode(UI_HIDDEN); ret = 1; } else if (cmd == KEYS_NEW_WINDOW) { - a_UIcmd_browser_window_new(w(),h(),a_UIcmd_get_bw_by_widget(this)); + a_UIcmd_browser_window_new(w(),h(),0,a_UIcmd_get_bw_by_widget(this)); ret = 1; } else if (cmd == KEYS_OPEN) { a_UIcmd_open_file(a_UIcmd_get_bw_by_widget(this)); diff --git a/src/uicmd.cc b/src/uicmd.cc index 4aa0da8f..c6954652 100644 --- a/src/uicmd.cc +++ b/src/uicmd.cc @@ -28,6 +28,7 @@ #include "timeout.hh" #include "menu.hh" #include "dialog.hh" +#include "xembed.hh" #include "bookmark.h" #include "history.h" #include "msg.h" @@ -387,10 +388,11 @@ void a_UIcmd_send_event_to_tabs_by_wid(int e, void *v_wid) * Create a new UI and its associated BrowserWindow data structure. * Use style from v_ui. If non-NULL it must be of type UI*. */ -BrowserWindow *a_UIcmd_browser_window_new(int ww, int wh, const void *vbw) +BrowserWindow *a_UIcmd_browser_window_new(int ww, int wh, uint32_t xid, const void *vbw) { BrowserWindow *old_bw = (BrowserWindow*)vbw; BrowserWindow *new_bw = NULL; + Xembed *win; if (ww <= 0 || wh <= 0) { // Set default geometry from dillorc. @@ -398,7 +400,8 @@ BrowserWindow *a_UIcmd_browser_window_new(int ww, int wh, const void *vbw) wh = prefs.height; } - Window *win = new Window(ww, wh); + win = new Xembed(ww, wh); + win->shortcut(0); // Ignore Escape if (prefs.buffered_drawing != 2) win->clear_double_buffer(); @@ -417,6 +420,8 @@ BrowserWindow *a_UIcmd_browser_window_new(int ww, int wh, const void *vbw) DilloTabs->add(new_ui); DilloTabs->resizable(new_ui); DilloTabs->window()->resizable(new_ui); + if (xid) + win->embed(xid); DilloTabs->window()->show(); if (old_bw == NULL && prefs.xpos >= 0 && prefs.ypos >= 0) { @@ -472,7 +477,7 @@ static BrowserWindow *UIcmd_tab_new(const void *vbw) // WORKAROUND: limit the number of tabs because of a fltk bug if (ui->tabs()->children() >= 127) return a_UIcmd_browser_window_new(ui->window()->w(), ui->window()->h(), - vbw); + 0, vbw); // Create and set the UI UI *new_ui = new UI(0, 0, ui->w(), ui->h(), DEFAULT_TAB_LABEL, ui); diff --git a/src/uicmd.hh b/src/uicmd.hh index f10d43ee..282f1b8b 100644 --- a/src/uicmd.hh +++ b/src/uicmd.hh @@ -8,7 +8,7 @@ extern "C" { #endif /* __cplusplus */ -BrowserWindow *a_UIcmd_browser_window_new(int ww, int wh, const void *v_bw); +BrowserWindow *a_UIcmd_browser_window_new(int ww, int wh, uint32_t xid, const void *v_bw); BrowserWindow *a_UIcmd_get_bw_by_widget(void *v_wid); void a_UIcmd_send_event_to_tabs_by_wid(int e, void *v_wid); void a_UIcmd_open_urlstr(void *vbw, const char *urlstr); |