summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Hofmann <Johannes.Hofmann@gmx.de>2009-05-18 17:52:45 +0200
committerJohannes Hofmann <Johannes.Hofmann@gmx.de>2009-05-18 17:52:45 +0200
commit2ea9718c0a3297ff91c1219b3e011a8a3367461f (patch)
tree64ea43d63fa8f91dd3080e26475204ddb11fab04
parente949bbc7ed966ed47bebba5798756501bd285917 (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.
-rw-r--r--ChangeLog1
-rw-r--r--src/Makefile.am4
-rw-r--r--src/dillo.cc2
-rw-r--r--src/menu.cc2
-rw-r--r--src/nav.c2
-rw-r--r--src/ui.cc2
-rw-r--r--src/uicmd.cc11
-rw-r--r--src/uicmd.hh2
8 files changed, 17 insertions, 9 deletions
diff --git a/ChangeLog b/ChangeLog
index fcd48262..0df99825 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -83,6 +83,7 @@ dillo-2.1
- Support CSS @import directive.
- Disable form widgets while stylesheets are loading.
- Fix image scaling on reload with border, margin, or padding > 0.
+ - Implement --xid command line option (used by claws mail client).
Patches: Johannes Hofmann
+- Updated the GPL copyright note in the source files.
Patch: Detlef Riekenberg
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) {
diff --git a/src/nav.c b/src/nav.c
index f2ccac86..cdc0db5e 100644
--- a/src/nav.c
+++ b/src/nav.c
@@ -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);
}
diff --git a/src/ui.cc b/src/ui.cc
index 8b24d1b2..4140fca9 100644
--- a/src/ui.cc
+++ b/src/ui.cc
@@ -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);