netsurf: branch master updated. release/3.0-857-gc495c08
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/c495c08626f826092c7ff...
...commit http://git.netsurf-browser.org/netsurf.git/commit/c495c08626f826092c7ff35...
...tree http://git.netsurf-browser.org/netsurf.git/tree/c495c08626f826092c7ff353d...
The branch, master has been updated
via c495c08626f826092c7ff353d2c573e0248ea46f (commit)
from 44a6c5bb17d56d5d6835b5027327a08a2c6c3f61 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=c495c08626f826092c7...
commit c495c08626f826092c7ff353d2c573e0248ea46f
Author: Ole Loots <ole(a)monochrom.net>
Commit: Ole Loots <ole(a)monochrom.net>
Default downloads directory name is "downloads" not "download"
diff --git a/atari/Makefile.target b/atari/Makefile.target
index f4dba23..2833613 100644
--- a/atari/Makefile.target
+++ b/atari/Makefile.target
@@ -168,7 +168,7 @@ endif
$(Q)rm -rf $(PKGNAME)
$(Q)mkdir $(ATARI_TARGET_DIR)
$(Q)mkdir $(ATARI_TARGET_DIR)doc
- $(Q)mkdir $(ATARI_TARGET_DIR)download
+ $(Q)mkdir $(ATARI_TARGET_DIR)downloads
$(Q)mkdir $(ATARI_TARGET_DIR)res
$(Q)mkdir $(ATARI_TARGET_DIR)res/fonts
$(Q)mkdir $(ATARI_TARGET_DIR)res/icons
-----------------------------------------------------------------------
Summary of changes:
atari/Makefile.target | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/atari/Makefile.target b/atari/Makefile.target
index f4dba23..2833613 100644
--- a/atari/Makefile.target
+++ b/atari/Makefile.target
@@ -168,7 +168,7 @@ endif
$(Q)rm -rf $(PKGNAME)
$(Q)mkdir $(ATARI_TARGET_DIR)
$(Q)mkdir $(ATARI_TARGET_DIR)doc
- $(Q)mkdir $(ATARI_TARGET_DIR)download
+ $(Q)mkdir $(ATARI_TARGET_DIR)downloads
$(Q)mkdir $(ATARI_TARGET_DIR)res
$(Q)mkdir $(ATARI_TARGET_DIR)res/fonts
$(Q)mkdir $(ATARI_TARGET_DIR)res/icons
--
NetSurf Browser
9 years
netsurf: branch master updated. release/3.0-856-g44a6c5b
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/44a6c5bb17d56d5d6835b...
...commit http://git.netsurf-browser.org/netsurf.git/commit/44a6c5bb17d56d5d6835b50...
...tree http://git.netsurf-browser.org/netsurf.git/tree/44a6c5bb17d56d5d6835b5027...
The branch, master has been updated
via 44a6c5bb17d56d5d6835b5027327a08a2c6c3f61 (commit)
from 0f5cc9f03aa9b41604ce69e8eccda94197d47442 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=44a6c5bb17d56d5d683...
commit 44a6c5bb17d56d5d6835b5027327a08a2c6c3f61
Author: Ole Loots <ole(a)monochrom.net>
Commit: Ole Loots <ole(a)monochrom.net>
Fix previous checking (do not call av/va functions)
diff --git a/atari/gemtk/guiwin.c b/atari/gemtk/guiwin.c
index 21381d7..9a5c93d 100644
--- a/atari/gemtk/guiwin.c
+++ b/atari/gemtk/guiwin.c
@@ -618,11 +618,19 @@ short gemtk_wm_dispatch_event(EVMULT_IN *ev_in, EVMULT_OUT *ev_out, short msg[8]
}
break;
+// TODO: check code with Thing! Desktop
+/*
+ We receive VA_PROTOSTATUS but AV_START doesn't seem to cause
+ an TeraDesk response. Check if something happens with Thing!
+ Desktop.
+/*
+/*
case VA_PROTOSTATUS:
case VA_VIEWED:
case AV_STARTED:
gemtk_av_dispatch(msg);
break;
+*/
}
} else {
-----------------------------------------------------------------------
Summary of changes:
atari/gemtk/guiwin.c | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/atari/gemtk/guiwin.c b/atari/gemtk/guiwin.c
index 21381d7..9a5c93d 100644
--- a/atari/gemtk/guiwin.c
+++ b/atari/gemtk/guiwin.c
@@ -618,11 +618,19 @@ short gemtk_wm_dispatch_event(EVMULT_IN *ev_in, EVMULT_OUT *ev_out, short msg[8]
}
break;
+// TODO: check code with Thing! Desktop
+/*
+ We receive VA_PROTOSTATUS but AV_START doesn't seem to cause
+ an TeraDesk response. Check if something happens with Thing!
+ Desktop.
+/*
+/*
case VA_PROTOSTATUS:
case VA_VIEWED:
case AV_STARTED:
gemtk_av_dispatch(msg);
break;
+*/
}
} else {
--
NetSurf Browser
9 years
netsurf: branch master updated. release/3.0-855-g0f5cc9f
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/0f5cc9f03aa9b41604ce6...
...commit http://git.netsurf-browser.org/netsurf.git/commit/0f5cc9f03aa9b41604ce69e...
...tree http://git.netsurf-browser.org/netsurf.git/tree/0f5cc9f03aa9b41604ce69e8e...
The branch, master has been updated
via 0f5cc9f03aa9b41604ce69e8eccda94197d47442 (commit)
from cd70ecd4055248fec6739e63df5e5a2bcb6c265b (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=0f5cc9f03aa9b41604c...
commit 0f5cc9f03aa9b41604ce69e8eccda94197d47442
Author: Ole Loots <ole(a)monochrom.net>
Commit: Ole Loots <ole(a)monochrom.net>
Added prototype for plot_get_abs_clipping_grect
diff --git a/atari/plot/plot.h b/atari/plot/plot.h
index 31c64c8..00546e8 100755
--- a/atari/plot/plot.h
+++ b/atari/plot/plot.h
@@ -111,6 +111,7 @@ float plot_get_scale(void);
float plot_set_scale(float);
void plot_set_abs_clipping(const GRECT *area);
void plot_get_abs_clipping(struct rect *dst);
+void plot_get_abs_clipping_grect(GRECT *dst);
bool plot_get_clip(struct rect * out);
/* Get clipping for current framebuffer as GRECT */
void plot_get_clip_grect(GRECT * out);
-----------------------------------------------------------------------
Summary of changes:
atari/plot/plot.h | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/atari/plot/plot.h b/atari/plot/plot.h
index 31c64c8..00546e8 100755
--- a/atari/plot/plot.h
+++ b/atari/plot/plot.h
@@ -111,6 +111,7 @@ float plot_get_scale(void);
float plot_set_scale(float);
void plot_set_abs_clipping(const GRECT *area);
void plot_get_abs_clipping(struct rect *dst);
+void plot_get_abs_clipping_grect(GRECT *dst);
bool plot_get_clip(struct rect * out);
/* Get clipping for current framebuffer as GRECT */
void plot_get_clip_grect(GRECT * out);
--
NetSurf Browser
9 years
netsurf: branch master updated. release/3.0-854-gcd70ecd
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/cd70ecd4055248fec6739...
...commit http://git.netsurf-browser.org/netsurf.git/commit/cd70ecd4055248fec6739e6...
...tree http://git.netsurf-browser.org/netsurf.git/tree/cd70ecd4055248fec6739e63d...
The branch, master has been updated
via cd70ecd4055248fec6739e63df5e5a2bcb6c265b (commit)
from ad3f3590e455213543678adda014af0281e2e98d (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=cd70ecd4055248fec67...
commit cd70ecd4055248fec6739e63df5e5a2bcb6c265b
Author: Ole Loots <ole(a)monochrom.net>
Commit: Ole Loots <ole(a)monochrom.net>
Added VA/AV Protocol support (not used yet).
diff --git a/atari/gemtk/gemtk.h b/atari/gemtk/gemtk.h
index f16b4a7..e5915e6 100644
--- a/atari/gemtk/gemtk.h
+++ b/atari/gemtk/gemtk.h
@@ -106,6 +106,14 @@ short gemtk_dd_rtry(short fd, char *name, char *file, char *whichext, long *size
short gemtk_dd_reply(short fd, char ack);
/* -------------------------------------------------------------------------- */
+/* AV/VA Protocol Module */
+/* -------------------------------------------------------------------------- */
+int gemtk_av_init(const char *appname);
+void gemtk_av_exit(void);
+bool gemtk_av_send (short message, const char * data1, const char * data2);
+bool gemtk_av_dispatch (short msg[8]);
+
+/* -------------------------------------------------------------------------- */
/* Message Box module */
/* -------------------------------------------------------------------------- */
#define GEMTK_MSG_BOX_ALERT 1
diff --git a/atari/gemtk/guiwin.c b/atari/gemtk/guiwin.c
index 920f53e..21381d7 100644
--- a/atari/gemtk/guiwin.c
+++ b/atari/gemtk/guiwin.c
@@ -25,6 +25,7 @@
#include <cflib.h>
#include "gemtk.h"
+#include "vaproto.h"
//#define DEBUG_PRINT(x) printf x
#define DEBUG_PRINT(x)
@@ -617,6 +618,11 @@ short gemtk_wm_dispatch_event(EVMULT_IN *ev_in, EVMULT_OUT *ev_out, short msg[8]
}
break;
+ case VA_PROTOSTATUS:
+ case VA_VIEWED:
+ case AV_STARTED:
+ gemtk_av_dispatch(msg);
+ break;
}
} else {
diff --git a/atari/gemtk/vaproto.c b/atari/gemtk/vaproto.c
new file mode 100644
index 0000000..45e4722
--- /dev/null
+++ b/atari/gemtk/vaproto.c
@@ -0,0 +1,170 @@
+#include <limits.h>
+#include <unistd.h>
+#include <stdbool.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <assert.h>
+#include <gem.h>
+
+#include "vaproto.h"
+#include "gemtk.h"
+
+#ifndef NDEBUG
+# define DEBUG_PRINT(x) printf x
+#else
+# define DEBUG_PRINT(x)
+#endif
+
+
+/* Global memory, at least 1024 bytes large: */
+static char *va_helpbuf;
+
+/* Desktop's AES ID: */
+static short av_shell_id = -1;
+
+/* What AV commands can desktop do? */
+static short av_shell_status = 0;
+
+/* The application name used for AV/VA messages: */
+static const char * av_clientname = "gemtk_av_app";
+
+
+static short get_avserver(void)
+{
+ short ret = -100;
+ const char * av_env = getenv("AVSERVER");
+ if (av_env) {
+ char av_envname[9];
+ strncpy(av_envname,av_env, 8);
+ av_envname[8] = '\0';
+ while (strlen (av_envname) < 8) {
+ strcat(av_envname, " ");
+ }
+ ret = appl_find (av_envname);
+ }
+ return ret;
+}
+
+/**
+ * initialitze the AV client API
+ * \param appname Name of the application passed to menu_register()
+ * \return returns 1 on success, otherwise an negative error code.
+ *
+ */
+int gemtk_av_init(const char *appname)
+{
+ short mode = 0x0003 /* prefer TT ram */
+ | 0x0020; /* global accesible */
+
+ if(av_shell_id != -1) {
+ /* Already initialized */
+ return(1);
+ }
+
+ va_helpbuf = (char*)Mxalloc(1024, mode);
+
+ if(va_helpbuf == NULL){
+ gemtk_msg_box_show(GEMTK_MSG_BOX_ALERT, "Could not allocate AV memory!");
+ return(-1);
+ }
+
+ if(appname != NULL){
+ av_clientname = appname;
+ }
+
+ av_shell_id = get_avserver();
+ DEBUG_PRINT(("AV Server ID: %d", av_shell_id));
+
+ gemtk_av_send(AV_PROTOKOLL, NULL, NULL);
+
+ va_helpbuf[0] = '\0';
+}
+
+void gemtk_av_exit(void)
+{
+ if(av_shell_id == -1) {
+ /* Nothing to do */
+ return;
+ }
+
+ if (av_shell_status & AA_EXIT) {
+ /* AV server knows AV_EXIT */
+ gemtk_av_send(AV_EXIT, NULL, NULL);
+ }
+
+ if(va_helpbuf != NULL){
+ free(va_helpbuf);
+ va_helpbuf = NULL;
+ }
+
+ av_shell_id = -1;
+
+}
+
+bool gemtk_av_send (short message, const char * data1, const char * data2)
+{
+ short msg[8];
+ short to_ap_id = av_shell_id;
+
+ /* - 100 to ap id would be no AV server */
+ if (to_ap_id == -100){
+ return false;
+ }
+
+ msg[0] = message;
+ msg[1] = gl_apid;
+ msg[7] = msg[6] = msg[5] = msg[4] = msg[3] = msg[2] = 0;
+
+ switch (message)
+ {
+ case AV_EXIT:
+ msg[3] = gl_apid;
+ break;
+ case AV_PROTOKOLL:
+ msg[3] = VV_START | VV_ACC_QUOTING;
+ *(char **)(msg+6) = strcpy (va_helpbuf, av_clientname);
+ break;
+ case AV_STARTPROG:
+ DEBUG_PRINT(("AV_STARTPROG: %s (%s)\n", data1, data2));
+ *(char **)(msg+3) = strcpy(va_helpbuf, data1);
+ *(char **)(msg+5) = strcpy(va_helpbuf, data2);
+ break;
+ case AV_VIEW:
+ DEBUG_PRINT(("AV_VIEW: %s (%d)\n", data1, (short)data2));
+ *(char **)(msg+3) = strcpy(va_helpbuf, data1);
+ msg[5] = (short)data2;
+ break;
+ default:
+ return false; /* not supported */
+ }
+
+ return (appl_write (to_ap_id, 16, msg) > 0);
+}
+
+bool gemtk_av_dispatch (short msg[8])
+{
+
+ if(av_shell_id == -1)
+ return(false);
+
+ switch (msg[0]) {
+ case VA_PROTOSTATUS :
+ DEBUG_PRINT(("AV STATUS: %d for %d\n", msg[3], msg[1]));
+ if (msg[1] == av_shell_id) {
+ av_shell_status = msg[3];
+ if(av_shell_status & AA_STARTPROG){
+ printf(" AA_STARTPROG\n");
+ }
+ }
+ break;
+
+ default:
+ DEBUG_PRINT(("Unknown AV message: %d", msg[0]));
+ break;
+ }
+
+ return(true);
+}
+
+
diff --git a/atari/gemtk/vaproto.h b/atari/gemtk/vaproto.h
new file mode 100644
index 0000000..84e0ecf
--- /dev/null
+++ b/atari/gemtk/vaproto.h
@@ -0,0 +1,121 @@
+#ifndef VAPROTO_H_INCLUDED
+#define VAPROTO_H_INCLUDED
+
+
+#define VAPRO 1
+
+/* AES-Messages */
+
+typedef enum
+{
+ AV_PROTOKOLL = 0x4700,
+ VA_PROTOSTATUS = 0x4701,
+ AV_GETSTATUS = 0x4703,
+ AV_STATUS = 0x4704,
+ VA_SETSTATUS = 0x4705,
+ AV_SENDKEY = 0x4710,
+ VA_START = 0x4711,
+ AV_ASKFILEFONT = 0x4712,
+ VA_FILEFONT = 0x4713,
+ AV_ASKCONFONT = 0x4714,
+ VA_CONFONT = 0x4715,
+ AV_ASKOBJECT = 0x4716,
+ VA_OBJECT = 0x4717,
+ AV_OPENCONSOLE = 0x4718,
+ VA_CONSOLEOPEN = 0x4719,
+ AV_OPENWIND = 0x4720,
+ VA_WINDOPEN = 0x4721,
+ AV_STARTPROG = 0x4722,
+ VA_PROGSTART = 0x4723,
+ AV_ACCWINDOPEN = 0x4724,
+ VA_DRAGACCWIND = 0x4725,
+ AV_ACCWINDCLOSED = 0x4726,
+
+ AV_COPY_DRAGGED = 0x4728,
+ VA_COPY_COMPLETE = 0x4729,
+ AV_PATH_UPDATE = 0x4730,
+ AV_WHAT_IZIT = 0x4732,
+ VA_THAT_IZIT = 0x4733,
+ AV_DRAG_ON_WINDOW = 0x4734,
+ VA_DRAG_COMPLETE = 0x4735,
+ AV_EXIT = 0x4736,
+ AV_STARTED = 0x4738,
+ VA_FONTCHANGED = 0x4739,
+ AV_XWIND = 0x4740,
+ VA_XOPEN = 0x4741,
+
+/* Neue Messages seit dem 26.06.1995 */
+
+ AV_VIEW = 0x4751,
+ VA_VIEWED = 0x4752,
+ AV_FILEINFO = 0x4753,
+ VA_FILECHANGED = 0x4754,
+ AV_COPYFILE = 0x4755,
+ VA_FILECOPIED = 0x4756,
+ AV_DELFILE = 0x4757,
+ VA_FILEDELETED = 0x4758,
+ AV_SETWINDPOS = 0x4759,
+ VA_PATH_UPDATE = 0x4760,
+ VA_HIGH /* HR please always do this! */
+} AV_VA;
+
+
+/* Objekttypen fr VA_THAT_IZIT */
+
+enum
+{
+ VA_OB_UNKNOWN,
+ VA_OB_TRASHCAN,
+ VA_OB_SHREDDER,
+ VA_OB_CLIPBOARD,
+ VA_OB_FILE,
+ VA_OB_FOLDER,
+ VA_OB_DRIVE,
+ VA_OB_WINDOW,
+ VA_OB_NOTEPAD,
+ VA_OB_NOTE
+};
+
+typedef enum
+{
+ VV_SETSTATUS = 0x0001,
+ VV_START = 0x0002,
+ VV_STARTED = 0x0004,
+ VV_FONTCHANGED = 0x0008,
+ VV_ACC_QUOTING = 0x0010,
+ VV_PATH_UPDATE = 0x0020
+} av_va_give;
+
+typedef enum
+{ /* mp[3]: */
+ AA_SENDKEY = 0x0001, /* b0: MAGXDESK, THING */
+ AA_ASKFILEFONT = 0x0002, /* b1: THING */
+ AA_ASKCONFONT = 0x0004, /* b2: THING */
+ AA_ASKOBJECT = 0x0008,
+ AA_OPENWIND = 0x0010, /* b4: MAGXDESK, THING */
+ AA_STARTPROG = 0x0020, /* b5: MAGXDESK, THING */
+ AA_ACCWIND = 0x0040, /* b6: THING */
+ AA_STATUS = 0x0080, /* b7: THING */
+ AA_COPY_DRAGGED= 0x0100, /* b8: THING */
+ AA_DRAG_ON_WINDOW=0x0200, /* b9: MAGXDESK, THING */
+ AA_EXIT = 0x0400, /* b10: MAGXDESK, THING */
+ AA_XWIND = 0x0800, /* b11: MAGXDESK, THING */
+ AA_FONTCHANGED = 0x1000, /* b2: THING */
+ AA_STARTED = 0x2000, /* b13: MAGXDESK, THING */
+ AA_SRV_QUOTING = 0x4000, /* b14: THING */
+ AA_FILE = 0x8000, /* b15: THING */
+ /* mp[4]: THING */
+ AA_COPY = 0x0001,
+ AA_DELETE = 0x0002,
+ AA_VIEW = 0x0004,
+ AA_SETWINDPOS = 0x0008,
+ AA_COPYFILELINK= 0x0010,
+ AA_SENDCLICK = 0x0020
+} av_va_have;
+
+/* Makros zum Testen auf Quoting */
+
+#define VA_ACC_QUOTING(a) ((a) & VV_ACC_QUOTING)
+#define VA_SERVER_QUOTING(a) ((a) & AA_SRV_QUOTING)
+
+#endif // VAPROTO_H_INCLUDED
-----------------------------------------------------------------------
Summary of changes:
atari/gemtk/gemtk.h | 8 ++
atari/gemtk/guiwin.c | 6 ++
atari/gemtk/vaproto.c | 170 +++++++++++++++++++++++++++++++++++++++++++++++++
atari/gemtk/vaproto.h | 121 +++++++++++++++++++++++++++++++++++
4 files changed, 305 insertions(+), 0 deletions(-)
create mode 100644 atari/gemtk/vaproto.c
create mode 100644 atari/gemtk/vaproto.h
diff --git a/atari/gemtk/gemtk.h b/atari/gemtk/gemtk.h
index f16b4a7..e5915e6 100644
--- a/atari/gemtk/gemtk.h
+++ b/atari/gemtk/gemtk.h
@@ -106,6 +106,14 @@ short gemtk_dd_rtry(short fd, char *name, char *file, char *whichext, long *size
short gemtk_dd_reply(short fd, char ack);
/* -------------------------------------------------------------------------- */
+/* AV/VA Protocol Module */
+/* -------------------------------------------------------------------------- */
+int gemtk_av_init(const char *appname);
+void gemtk_av_exit(void);
+bool gemtk_av_send (short message, const char * data1, const char * data2);
+bool gemtk_av_dispatch (short msg[8]);
+
+/* -------------------------------------------------------------------------- */
/* Message Box module */
/* -------------------------------------------------------------------------- */
#define GEMTK_MSG_BOX_ALERT 1
diff --git a/atari/gemtk/guiwin.c b/atari/gemtk/guiwin.c
index 920f53e..21381d7 100644
--- a/atari/gemtk/guiwin.c
+++ b/atari/gemtk/guiwin.c
@@ -25,6 +25,7 @@
#include <cflib.h>
#include "gemtk.h"
+#include "vaproto.h"
//#define DEBUG_PRINT(x) printf x
#define DEBUG_PRINT(x)
@@ -617,6 +618,11 @@ short gemtk_wm_dispatch_event(EVMULT_IN *ev_in, EVMULT_OUT *ev_out, short msg[8]
}
break;
+ case VA_PROTOSTATUS:
+ case VA_VIEWED:
+ case AV_STARTED:
+ gemtk_av_dispatch(msg);
+ break;
}
} else {
diff --git a/atari/gemtk/vaproto.c b/atari/gemtk/vaproto.c
new file mode 100644
index 0000000..45e4722
--- /dev/null
+++ b/atari/gemtk/vaproto.c
@@ -0,0 +1,170 @@
+#include <limits.h>
+#include <unistd.h>
+#include <stdbool.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <assert.h>
+#include <gem.h>
+
+#include "vaproto.h"
+#include "gemtk.h"
+
+#ifndef NDEBUG
+# define DEBUG_PRINT(x) printf x
+#else
+# define DEBUG_PRINT(x)
+#endif
+
+
+/* Global memory, at least 1024 bytes large: */
+static char *va_helpbuf;
+
+/* Desktop's AES ID: */
+static short av_shell_id = -1;
+
+/* What AV commands can desktop do? */
+static short av_shell_status = 0;
+
+/* The application name used for AV/VA messages: */
+static const char * av_clientname = "gemtk_av_app";
+
+
+static short get_avserver(void)
+{
+ short ret = -100;
+ const char * av_env = getenv("AVSERVER");
+ if (av_env) {
+ char av_envname[9];
+ strncpy(av_envname,av_env, 8);
+ av_envname[8] = '\0';
+ while (strlen (av_envname) < 8) {
+ strcat(av_envname, " ");
+ }
+ ret = appl_find (av_envname);
+ }
+ return ret;
+}
+
+/**
+ * initialitze the AV client API
+ * \param appname Name of the application passed to menu_register()
+ * \return returns 1 on success, otherwise an negative error code.
+ *
+ */
+int gemtk_av_init(const char *appname)
+{
+ short mode = 0x0003 /* prefer TT ram */
+ | 0x0020; /* global accesible */
+
+ if(av_shell_id != -1) {
+ /* Already initialized */
+ return(1);
+ }
+
+ va_helpbuf = (char*)Mxalloc(1024, mode);
+
+ if(va_helpbuf == NULL){
+ gemtk_msg_box_show(GEMTK_MSG_BOX_ALERT, "Could not allocate AV memory!");
+ return(-1);
+ }
+
+ if(appname != NULL){
+ av_clientname = appname;
+ }
+
+ av_shell_id = get_avserver();
+ DEBUG_PRINT(("AV Server ID: %d", av_shell_id));
+
+ gemtk_av_send(AV_PROTOKOLL, NULL, NULL);
+
+ va_helpbuf[0] = '\0';
+}
+
+void gemtk_av_exit(void)
+{
+ if(av_shell_id == -1) {
+ /* Nothing to do */
+ return;
+ }
+
+ if (av_shell_status & AA_EXIT) {
+ /* AV server knows AV_EXIT */
+ gemtk_av_send(AV_EXIT, NULL, NULL);
+ }
+
+ if(va_helpbuf != NULL){
+ free(va_helpbuf);
+ va_helpbuf = NULL;
+ }
+
+ av_shell_id = -1;
+
+}
+
+bool gemtk_av_send (short message, const char * data1, const char * data2)
+{
+ short msg[8];
+ short to_ap_id = av_shell_id;
+
+ /* - 100 to ap id would be no AV server */
+ if (to_ap_id == -100){
+ return false;
+ }
+
+ msg[0] = message;
+ msg[1] = gl_apid;
+ msg[7] = msg[6] = msg[5] = msg[4] = msg[3] = msg[2] = 0;
+
+ switch (message)
+ {
+ case AV_EXIT:
+ msg[3] = gl_apid;
+ break;
+ case AV_PROTOKOLL:
+ msg[3] = VV_START | VV_ACC_QUOTING;
+ *(char **)(msg+6) = strcpy (va_helpbuf, av_clientname);
+ break;
+ case AV_STARTPROG:
+ DEBUG_PRINT(("AV_STARTPROG: %s (%s)\n", data1, data2));
+ *(char **)(msg+3) = strcpy(va_helpbuf, data1);
+ *(char **)(msg+5) = strcpy(va_helpbuf, data2);
+ break;
+ case AV_VIEW:
+ DEBUG_PRINT(("AV_VIEW: %s (%d)\n", data1, (short)data2));
+ *(char **)(msg+3) = strcpy(va_helpbuf, data1);
+ msg[5] = (short)data2;
+ break;
+ default:
+ return false; /* not supported */
+ }
+
+ return (appl_write (to_ap_id, 16, msg) > 0);
+}
+
+bool gemtk_av_dispatch (short msg[8])
+{
+
+ if(av_shell_id == -1)
+ return(false);
+
+ switch (msg[0]) {
+ case VA_PROTOSTATUS :
+ DEBUG_PRINT(("AV STATUS: %d for %d\n", msg[3], msg[1]));
+ if (msg[1] == av_shell_id) {
+ av_shell_status = msg[3];
+ if(av_shell_status & AA_STARTPROG){
+ printf(" AA_STARTPROG\n");
+ }
+ }
+ break;
+
+ default:
+ DEBUG_PRINT(("Unknown AV message: %d", msg[0]));
+ break;
+ }
+
+ return(true);
+}
+
+
diff --git a/atari/gemtk/vaproto.h b/atari/gemtk/vaproto.h
new file mode 100644
index 0000000..84e0ecf
--- /dev/null
+++ b/atari/gemtk/vaproto.h
@@ -0,0 +1,121 @@
+#ifndef VAPROTO_H_INCLUDED
+#define VAPROTO_H_INCLUDED
+
+
+#define VAPRO 1
+
+/* AES-Messages */
+
+typedef enum
+{
+ AV_PROTOKOLL = 0x4700,
+ VA_PROTOSTATUS = 0x4701,
+ AV_GETSTATUS = 0x4703,
+ AV_STATUS = 0x4704,
+ VA_SETSTATUS = 0x4705,
+ AV_SENDKEY = 0x4710,
+ VA_START = 0x4711,
+ AV_ASKFILEFONT = 0x4712,
+ VA_FILEFONT = 0x4713,
+ AV_ASKCONFONT = 0x4714,
+ VA_CONFONT = 0x4715,
+ AV_ASKOBJECT = 0x4716,
+ VA_OBJECT = 0x4717,
+ AV_OPENCONSOLE = 0x4718,
+ VA_CONSOLEOPEN = 0x4719,
+ AV_OPENWIND = 0x4720,
+ VA_WINDOPEN = 0x4721,
+ AV_STARTPROG = 0x4722,
+ VA_PROGSTART = 0x4723,
+ AV_ACCWINDOPEN = 0x4724,
+ VA_DRAGACCWIND = 0x4725,
+ AV_ACCWINDCLOSED = 0x4726,
+
+ AV_COPY_DRAGGED = 0x4728,
+ VA_COPY_COMPLETE = 0x4729,
+ AV_PATH_UPDATE = 0x4730,
+ AV_WHAT_IZIT = 0x4732,
+ VA_THAT_IZIT = 0x4733,
+ AV_DRAG_ON_WINDOW = 0x4734,
+ VA_DRAG_COMPLETE = 0x4735,
+ AV_EXIT = 0x4736,
+ AV_STARTED = 0x4738,
+ VA_FONTCHANGED = 0x4739,
+ AV_XWIND = 0x4740,
+ VA_XOPEN = 0x4741,
+
+/* Neue Messages seit dem 26.06.1995 */
+
+ AV_VIEW = 0x4751,
+ VA_VIEWED = 0x4752,
+ AV_FILEINFO = 0x4753,
+ VA_FILECHANGED = 0x4754,
+ AV_COPYFILE = 0x4755,
+ VA_FILECOPIED = 0x4756,
+ AV_DELFILE = 0x4757,
+ VA_FILEDELETED = 0x4758,
+ AV_SETWINDPOS = 0x4759,
+ VA_PATH_UPDATE = 0x4760,
+ VA_HIGH /* HR please always do this! */
+} AV_VA;
+
+
+/* Objekttypen fr VA_THAT_IZIT */
+
+enum
+{
+ VA_OB_UNKNOWN,
+ VA_OB_TRASHCAN,
+ VA_OB_SHREDDER,
+ VA_OB_CLIPBOARD,
+ VA_OB_FILE,
+ VA_OB_FOLDER,
+ VA_OB_DRIVE,
+ VA_OB_WINDOW,
+ VA_OB_NOTEPAD,
+ VA_OB_NOTE
+};
+
+typedef enum
+{
+ VV_SETSTATUS = 0x0001,
+ VV_START = 0x0002,
+ VV_STARTED = 0x0004,
+ VV_FONTCHANGED = 0x0008,
+ VV_ACC_QUOTING = 0x0010,
+ VV_PATH_UPDATE = 0x0020
+} av_va_give;
+
+typedef enum
+{ /* mp[3]: */
+ AA_SENDKEY = 0x0001, /* b0: MAGXDESK, THING */
+ AA_ASKFILEFONT = 0x0002, /* b1: THING */
+ AA_ASKCONFONT = 0x0004, /* b2: THING */
+ AA_ASKOBJECT = 0x0008,
+ AA_OPENWIND = 0x0010, /* b4: MAGXDESK, THING */
+ AA_STARTPROG = 0x0020, /* b5: MAGXDESK, THING */
+ AA_ACCWIND = 0x0040, /* b6: THING */
+ AA_STATUS = 0x0080, /* b7: THING */
+ AA_COPY_DRAGGED= 0x0100, /* b8: THING */
+ AA_DRAG_ON_WINDOW=0x0200, /* b9: MAGXDESK, THING */
+ AA_EXIT = 0x0400, /* b10: MAGXDESK, THING */
+ AA_XWIND = 0x0800, /* b11: MAGXDESK, THING */
+ AA_FONTCHANGED = 0x1000, /* b2: THING */
+ AA_STARTED = 0x2000, /* b13: MAGXDESK, THING */
+ AA_SRV_QUOTING = 0x4000, /* b14: THING */
+ AA_FILE = 0x8000, /* b15: THING */
+ /* mp[4]: THING */
+ AA_COPY = 0x0001,
+ AA_DELETE = 0x0002,
+ AA_VIEW = 0x0004,
+ AA_SETWINDPOS = 0x0008,
+ AA_COPYFILELINK= 0x0010,
+ AA_SENDCLICK = 0x0020
+} av_va_have;
+
+/* Makros zum Testen auf Quoting */
+
+#define VA_ACC_QUOTING(a) ((a) & VV_ACC_QUOTING)
+#define VA_SERVER_QUOTING(a) ((a) & AA_SRV_QUOTING)
+
+#endif // VAPROTO_H_INCLUDED
--
NetSurf Browser
9 years
netsurf: branch master updated. release/3.0-853-gad3f359
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/ad3f3590e455213543678...
...commit http://git.netsurf-browser.org/netsurf.git/commit/ad3f3590e455213543678ad...
...tree http://git.netsurf-browser.org/netsurf.git/tree/ad3f3590e455213543678adda...
The branch, master has been updated
via ad3f3590e455213543678adda014af0281e2e98d (commit)
via 375ee78d1c99d04427c7d96096d85e983333fa5d (commit)
via 62f7cfb04b646c39f77857890c4ad84880c4d509 (commit)
via d6561e51e0540302537a5101485726c5c37894d8 (commit)
via 850432f9900f9e2130f522bf19483c111b49e9e8 (commit)
from 62047c923443415c59ec75b70e788e7d702c39b2 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=ad3f3590e4552135436...
commit ad3f3590e455213543678adda014af0281e2e98d
Merge: 62047c9 375ee78
Author: Vincent Sanders <vince(a)kyllikki.org>
Commit: Vincent Sanders <vince(a)kyllikki.org>
Merge branch 'mmu_man/haiku-fixes'
-----------------------------------------------------------------------
Summary of changes:
beos/gui.cpp | 52 ++++++++++++++++++++++++++++++++++---------------
beos/scaffolding.cpp | 3 +-
beos/window.cpp | 3 +-
css/select.c | 4 +-
desktop/treeview.c | 2 +-
utils/bloom.c | 3 +-
6 files changed, 45 insertions(+), 22 deletions(-)
diff --git a/beos/gui.cpp b/beos/gui.cpp
index ffaccc8..04a52bb 100644
--- a/beos/gui.cpp
+++ b/beos/gui.cpp
@@ -38,6 +38,7 @@
#include <Mime.h>
#include <Path.h>
#include <Roster.h>
+#include <Screen.h>
#include <String.h>
extern "C" {
@@ -440,20 +441,23 @@ set_colour_from_ui(struct nsoption_s *opts,
enum nsoption_e option,
colour def_colour)
{
- if (ui != NOCOL) {
- rgb_color c;
- if (ui == B_DESKTOP_COLOR) {
+ if (ui != NOCOL) {
+ rgb_color c;
+ if (ui == B_DESKTOP_COLOR) {
BScreen s;
c = s.DesktopColor();
- } else {
- c = ui_color(ui);
- }
+ } else {
+ c = ui_color(ui);
+ }
- def_colour = ((((uint32_t)c.blue << 16) & 0xff0000) |
- ((c.green << 8) & 0x00ff00) |
- ((c.red) & 0x0000ff));
- }
- return def_colour;
+ def_colour = ((((uint32_t)c.blue << 16) & 0xff0000) |
+ ((c.green << 8) & 0x00ff00) |
+ ((c.red) & 0x0000ff));
+ }
+
+ opts[option].value.c = def_colour;
+
+ return NSERROR_OK;
}
/**
@@ -544,8 +548,8 @@ int main(int argc, char** argv)
die("NetSurf failed to initialise");
}
- gui_init(argc, argv);
- gui_init2(argc, argv);
+ gui_init(argc, argv);
+ gui_init2(argc, argv);
netsurf_main_loop();
@@ -557,6 +561,7 @@ int main(int argc, char** argv)
/** called when replicated from NSBaseView::Instantiate() */
int gui_init_replicant(int argc, char** argv)
{
+ nserror ret;
BPath options;
if (find_directory(B_USER_SETTINGS_DIRECTORY, &options, true) == B_OK) {
options.Append("x-vnd.NetSurf");
@@ -569,8 +574,22 @@ int gui_init_replicant(int argc, char** argv)
*/
nslog_init(nslog_stream_configure, &argc, argv);
- /* initialise netsurf */
- netsurf_init(&argc, &argv, options.Path(), messages);
+ // FIXME: use options as readonly for replicants
+ /* user options setup */
+ ret = nsoption_init(set_defaults, &nsoptions, &nsoptions_default);
+ if (ret != NSERROR_OK) {
+ // FIXME: must not die when in replicant!
+ die("Options failed to initialise");
+ }
+ nsoption_read(options.Path(), NULL);
+ nsoption_commandline(&argc, argv, NULL);
+
+ /* common initialisation */
+ ret = netsurf_init(messages);
+ if (ret != NSERROR_OK) {
+ // FIXME: must not die when in replicant!
+ die("NetSurf failed to initialise");
+ }
gui_init(argc, argv);
gui_init2(argc, argv);
@@ -593,7 +612,8 @@ void gui_init(int argc, char** argv)
}
// ui_color() gives hardcoded values before BApplication is created.
- nsbeos_update_system_ui_colors();
+ //FIXME:
+ //nsbeos_update_system_ui_colors();
fetch_rsrc_register();
diff --git a/beos/scaffolding.cpp b/beos/scaffolding.cpp
index 7834db4..252a816 100644
--- a/beos/scaffolding.cpp
+++ b/beos/scaffolding.cpp
@@ -702,7 +702,8 @@ void nsbeos_scaffolding_dispatch_event(nsbeos_scaffolding *scaffold, BMessage *m
break;
}
case B_UI_SETTINGS_CHANGED:
- nsbeos_update_system_ui_colors();
+ //FIXME:
+ //nsbeos_update_system_ui_colors();
nsbeos_scaffolding_update_colors(scaffold);
break;
case B_NETPOSITIVE_OPEN_URL:
diff --git a/beos/window.cpp b/beos/window.cpp
index 64ef616..5c5df96 100644
--- a/beos/window.cpp
+++ b/beos/window.cpp
@@ -650,7 +650,8 @@ void nsbeos_dispatch_event(BMessage *message)
case B_MOUSE_WHEEL_CHANGED:
break;
case B_UI_SETTINGS_CHANGED:
- nsbeos_update_system_ui_colors();
+ //FIXME:
+ //nsbeos_update_system_ui_colors();
break;
case 'nsLO': // login
{
diff --git a/css/select.c b/css/select.c
index a69c770..ee0e7da 100644
--- a/css/select.c
+++ b/css/select.c
@@ -1637,8 +1637,6 @@ css_error node_is_link(void *pw, void *n, bool *match)
*/
css_error node_is_visited(void *pw, void *node, bool *match)
{
- *match = false;
-
nscss_select_ctx *ctx = pw;
nsurl *url;
nserror error;
@@ -1648,6 +1646,8 @@ css_error node_is_visited(void *pw, void *node, bool *match)
dom_node *n = node;
dom_string *s = NULL;
+ *match = false;
+
exc = dom_node_get_node_name(n, &s);
if ((exc != DOM_NO_ERR) || (s == NULL)) {
return CSS_NOMEM;
diff --git a/desktop/treeview.c b/desktop/treeview.c
index 0681b95..a137c46 100644
--- a/desktop/treeview.c
+++ b/desktop/treeview.c
@@ -96,7 +96,7 @@ struct treeview_node {
struct treeview_node_entry {
treeview_node base;
- struct treeview_field fields[];
+ struct treeview_field fields[FLEX_ARRAY_LEN_DECL];
}; /**< Entry class inherits node base class */
struct treeview_pos {
diff --git a/utils/bloom.c b/utils/bloom.c
index 1b07d6f..df9e76e 100644
--- a/utils/bloom.c
+++ b/utils/bloom.c
@@ -21,6 +21,7 @@
#include <stdlib.h>
#include "utils/bloom.h"
+#include "utils/utils.h"
/**
* Hash a string, returning a 32bit value. The hash algorithm used is
@@ -50,7 +51,7 @@ static inline uint32_t fnv(const char *datum, size_t len)
struct bloom_filter {
size_t size;
uint32_t items;
- uint8_t filter[];
+ uint8_t filter[FLEX_ARRAY_LEN_DECL];
};
struct bloom_filter *bloom_create(size_t size)
--
NetSurf Browser
9 years
netsurf: branch master updated. release/3.0-848-g62047c9
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/62047c923443415c59ec7...
...commit http://git.netsurf-browser.org/netsurf.git/commit/62047c923443415c59ec75b...
...tree http://git.netsurf-browser.org/netsurf.git/tree/62047c923443415c59ec75b70...
The branch, master has been updated
via 62047c923443415c59ec75b70e788e7d702c39b2 (commit)
via ea28b07cae4d0d40850be1417bd00e555e6168fb (commit)
via 604108916923146c888e6659bd5df24fab460e41 (commit)
via 56b0465e88f9941bd05fe7492a4d6b4e9bb7f9f0 (commit)
via 2506471b34200940eda71ff4b9f390f0697425db (commit)
via 20b3d960e585a3b13a40bc2eddd40d526597eeac (commit)
via 5c25b2e47d78da935dbf8b957dc709f3e371cbf4 (commit)
via f64c8ed9ef976618d36f7e07285e4755c0c9c11c (commit)
via 6300c7ed90b472dc9a5f21d8054fd2e2689c8c9a (commit)
via 1019692b882860bcae923fedb23269cbd2f0121b (commit)
via 01b85ff7c54f8250083700aa6ec7dceb52c233a1 (commit)
via b8dd4f282b521f881f33841a9e3bb101f933c349 (commit)
via f825521072ed7e459e7fa465cf66efd24f5feb76 (commit)
from 8b6874effd85a476af488a5c747a7ab861f576d8 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=62047c923443415c59e...
commit 62047c923443415c59ec75b70e788e7d702c39b2
Merge: 8b6874e ea28b07
Author: Vincent Sanders <vince(a)kyllikki.org>
Commit: Vincent Sanders <vince(a)kyllikki.org>
Merge remote-tracking branch 'origin/stevef/hotlist'
-----------------------------------------------------------------------
Summary of changes:
resources/FatMessages | 25 ++++++++
riscos/gui/url_bar.c | 151 +++++++++++++++++++++++--------------------------
riscos/gui/url_bar.h | 8 ++-
riscos/hotlist.c | 122 +++++++++++++++++++++++++++++++++++++---
riscos/hotlist.h | 2 +
riscos/mouse.c | 16 +++++-
riscos/options.h | 1 +
riscos/toolbar.c | 25 +++++++-
riscos/toolbar.h | 13 +++-
riscos/window.c | 47 ++++++++++++++--
10 files changed, 305 insertions(+), 105 deletions(-)
diff --git a/resources/FatMessages b/resources/FatMessages
index 44598c5..2d74f3d 100644
--- a/resources/FatMessages
+++ b/resources/FatMessages
@@ -3051,6 +3051,11 @@ de.all.OverwriteFile:Eine Datei mit diesem Namen existiert bereits und würde ü
fr.all.OverwriteFile:Un fichier portant ce nom existe déjà et serait perdu.
it.all.OverwriteFile:Un file con questo nome è già esistente, continuare comporterà la sovrascrittura del file originale.
nl.all.OverwriteFile:Een bestand met deze naam bestaat al en zal verloren gaan.
+en.all.RemoveHotlist:Are you sure you wish to remove this address from the hotlist?
+de.all.RemoveHotlist:Are you sure you wish to remove this address from the hotlist?
+fr.all.RemoveHotlist:Are you sure you wish to remove this address from the hotlist?
+it.all.RemoveHotlist:Are you sure you wish to remove this address from the hotlist?
+nl.all.RemoveHotlist:Are you sure you wish to remove this address from the hotlist?
# Page fetching
# =============
@@ -3590,6 +3595,16 @@ de.all.DontReplace:Abbrechen
fr.all.DontReplace:Ne pas remplacer le fichier
it.all.DontReplace:Non sostituire
nl.all.DontReplace:Bestand niet vervangen
+en.all.Remove:Remove address
+de.all.Remove:Remove address
+rf.all.Remove:Remove address
+it.all.Remove:Remove address
+nl.all.Remove:Remove address
+en.all.DontRemove:Don't remove
+de.all.DontRemove:Don't remove
+rf.all.DontRemove:Don't remove
+it.all.DontRemove:Don't remove
+nl.all.DontRemove:Don't remove
en.all.obj:object
de.all.obj:Objekt
fr.all.obj:objet
@@ -3696,6 +3711,16 @@ de.ro.HelpToolbar16:Das ist die Ladeaktivitätsanzeige.|MSie wird animiert, wenn
fr.ro.HelpToolbar16:\Tle pulseur.|MIl s'anime lorsque cette \w est active.
it.ro.HelpToolbar16:\Tthrobber animato durante le attività di rete
nl.ro.HelpToolbar16:\Tthrobber.|MIt animates while this \w is active.
+en.ro.HelpToolbarFav:\TFavicon: a small logo supplied by the current site, if available.
+de.ro.HelpToolbarFav:\TFavicon: a small logo supplied by the current site, if available.
+fr.ro.HelpToolbarFav:\TFavicon: a small logo supplied by the current site, if available.
+it.ro.HelpToolbarFav:\TFavicon: a small logo supplied by the current site, if available.
+nl.ro.HelpToolbarFav:\TFavicon: a small logo supplied by the current site, if available.
+en.ro.HelpToolbarHot:\Thotlist indicator: if lit, the current address is in the hotlist.|M\Sto add the current address to the hotlist.|M\Ato remove the current address from the hotlist.
+de.ro.HelpToolbarHot:\Thotlist indicator: if lit, the current address is in the hotlist.|M\Sto add the current address to the hotlist.|M\Ato remove the current address from the hotlist.
+fr.ro.HelpToolbarHot:\Thotlist indicator: if lit, the current address is in the hotlist.|M\Sto add the current address to the hotlist.|M\Ato remove the current address from the hotlist.
+it.ro.HelpToolbarHot:\Thotlist indicator: if lit, the current address is in the hotlist.|M\Sto add the current address to the hotlist.|M\Ato remove the current address from the hotlist.
+nl.ro.HelpToolbarHot:\Thotlist indicator: if lit, the current address is in the hotlist.|M\Sto add the current address to the hotlist.|M\Ato remove the current address from the hotlist.
en.ro.HelpStatus0:\Tstatus bar resizer.|MDrag to alter the size of the status bar.
de.ro.HelpStatus0:Das ist die Begrenzung der Statusanzeige.|MKlicken und Ziehen verändert die Länge der Statusanzeige.
diff --git a/riscos/gui/url_bar.c b/riscos/gui/url_bar.c
index eede2ac..845f8b3 100644
--- a/riscos/gui/url_bar.c
+++ b/riscos/gui/url_bar.c
@@ -30,7 +30,7 @@
#include "oslib/os.h"
#include "oslib/osspriteop.h"
#include "oslib/wimp.h"
-#include "desktop/hotlist.h"
+#include "riscos/hotlist.h"
#include "riscos/gui/url_bar.h"
#include "riscos/theme.h"
#include "riscos/url_suggest.h"
@@ -83,7 +83,7 @@ struct url_bar {
bool shaded;
struct {
- bool add;
+ bool set;
os_box extent;
os_coord offset;
} hotlist;
@@ -111,6 +111,7 @@ static struct url_bar_resource url_bar_res[URLBAR_RES_LAST] = {
}; /**< Treeview content resources */
+static void ro_gui_url_bar_set_hotlist(struct url_bar *url_bar, bool set);
/* This is an exported interface documented in url_bar.h */
@@ -159,7 +160,7 @@ struct url_bar *ro_gui_url_bar_create(struct theme_descriptor *theme)
strncpy(url_bar->favicon_sprite, "Ssmall_xxx",
URLBAR_FAVICON_NAME_LENGTH);
- url_bar->hotlist.add = true;
+ url_bar->hotlist.set = false;
url_bar->hotlist.extent.x0 = 0;
url_bar->hotlist.extent.y0 = 0;
url_bar->hotlist.extent.x1 = 0;
@@ -337,7 +338,10 @@ static bool ro_gui_url_bar_icon_update(struct url_bar *url_bar)
if (!url_bar->hidden && url_bar->container_icon == -1) {
icon.icon.flags = wimp_ICON_BORDER |
- (wimp_COLOUR_BLACK << wimp_ICON_FG_COLOUR_SHIFT);
+ (wimp_COLOUR_BLACK <<
+ wimp_ICON_FG_COLOUR_SHIFT) |
+ (wimp_BUTTON_DOUBLE_CLICK_DRAG <<
+ wimp_ICON_BUTTON_TYPE_SHIFT);
error = xwimp_create_icon(&icon, &url_bar->container_icon);
if (error != NULL) {
LOG(("xwimp_create_icon: 0x%x: %s",
@@ -694,9 +698,9 @@ void ro_gui_url_bar_redraw(struct url_bar *url_bar, wimp_draw *redraw)
.background_images = true,
.plot = &ro_plotters
};
- struct url_bar_resource *hotlist_icon = url_bar->hotlist.add ?
- &(url_bar_res[URLBAR_RES_HOTLIST_ADD]) :
- &(url_bar_res[URLBAR_RES_HOTLIST_REMOVE]);
+ struct url_bar_resource *hotlist_icon = url_bar->hotlist.set ?
+ &(url_bar_res[URLBAR_RES_HOTLIST_REMOVE]) :
+ &(url_bar_res[URLBAR_RES_HOTLIST_ADD]);
xwimp_set_colour(wimp_COLOUR_WHITE);
xos_plot(os_MOVE_TO,
@@ -757,41 +761,22 @@ bool ro_gui_url_bar_click(struct url_bar *url_bar,
pos.y > url_bar->extent.y1)
return false;
- /* If we have a click over the hotlist icon, hotlist add/remove. */
- /* TODO: this doesn't work
- * neither does the TOOLBAR_URL_DRAG_FAVICON below */
- if (pointer->buttons & (wimp_CLICK_SELECT | wimp_SINGLE_SELECT) &&
- url_bar->text_buffer != NULL) {
+ /* If we have a Select or Adjust click, check if it originated on the
+ * hotlist icon; if it did, return an event.
+ */
+
+ if (pointer->buttons == wimp_SINGLE_SELECT ||
+ pointer->buttons == wimp_SINGLE_ADJUST) {
if (pos.x >= url_bar->hotlist.extent.x0 &&
pos.x <= url_bar->hotlist.extent.x1 &&
pos.y >= url_bar->hotlist.extent.y0 &&
pos.y <= url_bar->hotlist.extent.y1) {
- nsurl *n;
- bool redraw = false;
- if (nsurl_create((const char *)url_bar->text_buffer,
- &n) == NSERROR_OK) {
- if (url_bar->hotlist.add) {
- if (hotlist_add_url(n)) {
- redraw = true;
- url_bar->hotlist.add = false;
- }
- } else {
- /* TODO: Open "Remove page from
- * Hotlist?" query dialogue box,
- * rather than silent removal. */
- hotlist_remove_url(n);
- redraw = true;
- url_bar->hotlist.add = true;
- }
- nsurl_unref(n);
-
- if (redraw && !url_bar->hidden)
- xwimp_force_redraw(url_bar->window,
- url_bar->hotlist.extent.x0,
- url_bar->hotlist.extent.y0,
- url_bar->hotlist.extent.x1,
- url_bar->hotlist.extent.y1);
- }
+ if (pointer->buttons == wimp_SINGLE_SELECT &&
+ action != NULL)
+ *action = TOOLBAR_URL_SELECT_HOTLIST;
+ else if (pointer->buttons == wimp_SINGLE_ADJUST &&
+ action != NULL)
+ *action = TOOLBAR_URL_ADJUST_HOTLIST;
return true;
}
}
@@ -909,6 +894,16 @@ bool ro_gui_url_bar_help_suffix(struct url_bar *url_bar, wimp_i i,
*suffix = "14";
else if (i == url_bar->suggest_icon)
*suffix = "15";
+ else if (pos.x >= url_bar->hotlist.extent.x0 &&
+ pos.x <= url_bar->hotlist.extent.x1 &&
+ pos.y >= url_bar->hotlist.extent.y0 &&
+ pos.y <= url_bar->hotlist.extent.y1)
+ *suffix = "Hot";
+ else if (pos.x >= url_bar->favicon_extent.x0 &&
+ pos.x <= url_bar->favicon_extent.x1 &&
+ pos.y >= url_bar->favicon_extent.y0 &&
+ pos.y <= url_bar->favicon_extent.y1)
+ *suffix = "Fav";
else
*suffix = "";
@@ -953,16 +948,8 @@ void ro_gui_url_bar_set_url(struct url_bar *url_bar, const char *url,
return;
if (nsurl_create(url, &n) == NSERROR_OK) {
- bool prev = url_bar->hotlist.add;
- url_bar->hotlist.add = !hotlist_has_url(n);
+ ro_gui_url_bar_set_hotlist(url_bar, ro_gui_hotlist_has_page(n));
nsurl_unref(n);
-
- if (prev != url_bar->hotlist.add && !url_bar->hidden)
- xwimp_force_redraw(url_bar->window,
- url_bar->hotlist.extent.x0,
- url_bar->hotlist.extent.y0,
- url_bar->hotlist.extent.x1,
- url_bar->hotlist.extent.y1);
}
if (url_bar->text_icon == -1) {
@@ -999,23 +986,42 @@ void ro_gui_url_bar_set_url(struct url_bar *url_bar, const char *url,
/* This is an exported interface documented in url_bar.h */
-void ro_gui_url_bar_hotlist_modifed(struct url_bar *url_bar, nsurl *url)
+void ro_gui_url_bar_update_hotlist(struct url_bar *url_bar)
{
+ const char *url;
nsurl *n;
- if (nsurl_create((const char *)url_bar->text_buffer,
- &n) == NSERROR_OK) {
- bool prev = url_bar->hotlist.add;
- url_bar->hotlist.add = !hotlist_has_url(n);
+ if (url_bar == NULL)
+ return;
+
+ url = (const char *) url_bar->text_buffer;
+ if (url != NULL && nsurl_create(url, &n) == NSERROR_OK) {
+ ro_gui_url_bar_set_hotlist(url_bar, ro_gui_hotlist_has_page(n));
nsurl_unref(n);
+ }
+}
+
+
+/**
+ * Set the state of a URL Bar's hotlist icon.
+ *
+ * \param *url_bar The URL Bar to update.
+ * \param set TRUE to set the hotlist icon; FALSE to clear it.
+ */
- if (prev != url_bar->hotlist.add && !url_bar->hidden) {
+static void ro_gui_url_bar_set_hotlist(struct url_bar *url_bar, bool set)
+{
+ if (url_bar == NULL || set == url_bar->hotlist.set)
+ return;
+
+ url_bar->hotlist.set = set;
+
+ if (!url_bar->hidden) {
xwimp_force_redraw(url_bar->window,
url_bar->hotlist.extent.x0,
url_bar->hotlist.extent.y0,
url_bar->hotlist.extent.x1,
url_bar->hotlist.extent.y1);
- }
}
}
@@ -1083,7 +1089,6 @@ bool ro_gui_url_bar_test_for_text_field_keypress(struct url_bar *url_bar,
{
const char *url;
nsurl *n;
- bool changed = false;
if (url_bar == NULL || url_bar->hidden || key == NULL)
return false;
@@ -1091,30 +1096,14 @@ bool ro_gui_url_bar_test_for_text_field_keypress(struct url_bar *url_bar,
if (key->w != url_bar->window || key->i != url_bar->text_icon)
return false;
- if (url_bar->hidden)
- return true;
-
/* Update hotlist indicator */
+
url = (const char *) url_bar->text_buffer;
if (url != NULL && nsurl_create(url, &n) == NSERROR_OK) {
- bool prev = url_bar->hotlist.add;
- url_bar->hotlist.add = !hotlist_has_url(n);
+ ro_gui_url_bar_set_hotlist(url_bar, ro_gui_hotlist_has_page(n));
nsurl_unref(n);
-
- if (prev != url_bar->hotlist.add) {
- changed = true;
- }
- } else if (!url_bar->hotlist.add) {
- url_bar->hotlist.add = true;
- changed = true;
- }
-
- if (changed) {
- xwimp_force_redraw(url_bar->window,
- url_bar->hotlist.extent.x0,
- url_bar->hotlist.extent.y0,
- url_bar->hotlist.extent.x1,
- url_bar->hotlist.extent.y1);
+ } else if (url_bar->hotlist.set) {
+ ro_gui_url_bar_set_hotlist(url_bar, false);
}
return true;
@@ -1166,12 +1155,12 @@ bool ro_gui_url_bar_set_site_favicon(struct url_bar *url_bar,
"Ssmall_xxx");
}
- if (!url_bar->hidden)
- xwimp_force_redraw(url_bar->window,
- url_bar->favicon_extent.x0,
- url_bar->favicon_extent.y0,
- url_bar->favicon_extent.x1,
- url_bar->favicon_extent.y1);
+ if (!url_bar->hidden)
+ xwimp_force_redraw(url_bar->window,
+ url_bar->favicon_extent.x0,
+ url_bar->favicon_extent.y0,
+ url_bar->favicon_extent.x1,
+ url_bar->favicon_extent.y1);
return true;
}
diff --git a/riscos/gui/url_bar.h b/riscos/gui/url_bar.h
index 04a8468..034f74d 100644
--- a/riscos/gui/url_bar.h
+++ b/riscos/gui/url_bar.h
@@ -34,6 +34,8 @@ typedef enum {
TOOLBAR_URL_NONE = 0, /* Special case: no action */
TOOLBAR_URL_DRAG_URL,
TOOLBAR_URL_DRAG_FAVICON,
+ TOOLBAR_URL_SELECT_HOTLIST,
+ TOOLBAR_URL_ADJUST_HOTLIST
} url_bar_action;
struct url_bar;
@@ -232,13 +234,13 @@ void ro_gui_url_bar_set_url(struct url_bar *url_bar, const char *url,
/**
- * Update urlbar's hotlist icon, if necessary.
+ * Update the state of a URL Bar's hotlist icon to reflect any changes to the
+ * URL or the contents of the hotlist.
*
* \param *url_bar The URL Bar to update.
- * \param *url URL with updated hotlist presence, or NULL if unknown.
*/
-void ro_gui_url_bar_hotlist_modifed(struct url_bar *url_bar, nsurl *url);
+void ro_gui_url_bar_update_hotlist(struct url_bar *url_bar);
/**
diff --git a/riscos/hotlist.c b/riscos/hotlist.c
index 7b5762f..f47d05e 100644
--- a/riscos/hotlist.c
+++ b/riscos/hotlist.c
@@ -62,6 +62,15 @@ static bool ro_gui_hotlist_menu_select(wimp_w w, wimp_i i, wimp_menu *menu,
static void ro_gui_hotlist_toolbar_click(button_bar_action action);
static void ro_gui_hotlist_addurl_bounce(wimp_message *message);
static void ro_gui_hotlist_scheduled_callback(void *p);
+static void ro_gui_hotlist_remove_confirmed(query_id id,
+ enum query_response res, void *p);
+static void ro_gui_hotlist_remove_cancelled(query_id id,
+ enum query_response res, void *p);
+
+static const query_callback remove_funcs = {
+ ro_gui_hotlist_remove_confirmed,
+ ro_gui_hotlist_remove_cancelled
+};
struct ro_treeview_callbacks ro_hotlist_treeview_callbacks = {
ro_gui_hotlist_toolbar_click,
@@ -85,6 +94,11 @@ struct ro_hotlist_message_hotlist_changed {
static char *hotlist_url = NULL; /**< URL area claimed from RMA. */
static char *hotlist_title = NULL; /**< Title area claimed from RMA. */
+/** Hotlist Query Handler. */
+
+static query_id hotlist_query = QUERY_INVALID;
+static nsurl *hotlist_delete_url = NULL;
+
/* The RISC OS hotlist window, toolbar and treeview data. */
static struct ro_hotlist {
@@ -241,6 +255,7 @@ void ro_gui_hotlist_toolbar_click(button_bar_action action)
switch (action) {
case TOOLBAR_BUTTON_DELETE:
hotlist_keypress(KEY_DELETE_LEFT);
+ ro_toolbar_update_all_hotlists();
break;
case TOOLBAR_BUTTON_EXPAND:
@@ -410,6 +425,7 @@ bool ro_gui_hotlist_menu_select(wimp_w w, wimp_i i, wimp_menu *menu,
return true;
case TREE_SELECTION_DELETE:
hotlist_keypress(KEY_DELETE_LEFT);
+ ro_toolbar_update_all_hotlists();
return true;
case TREE_SELECT_ALL:
hotlist_keypress(KEY_SELECT_ALL);
@@ -496,8 +512,6 @@ void ro_gui_hotlist_add_page(nsurl *url)
ro_gui_hotlist_add_cleanup();
- LOG(("Sending Hotlist AddURL to potential hotlist clients."));
-
data = urldb_get_url_data(url);
if (data == NULL)
return;
@@ -540,8 +554,6 @@ void ro_gui_hotlist_add_page(nsurl *url)
static void ro_gui_hotlist_addurl_bounce(wimp_message *message)
{
- LOG(("Hotlist AddURL Bounced"));
-
if (hotlist_url != NULL) {
nsurl *nsurl;
@@ -570,8 +582,6 @@ static void ro_gui_hotlist_addurl_bounce(wimp_message *message)
static void ro_gui_hotlist_scheduled_callback(void *p)
{
- LOG(("Hotlist AddURL was claimed by something."));
-
ro_gui_hotlist_add_cleanup();
}
@@ -582,8 +592,6 @@ static void ro_gui_hotlist_scheduled_callback(void *p)
void ro_gui_hotlist_add_cleanup(void)
{
- LOG(("Clean up RMA"));
-
if (hotlist_url != NULL) {
osmodule_free(hotlist_url);
hotlist_url = NULL;
@@ -596,6 +604,104 @@ void ro_gui_hotlist_add_cleanup(void)
}
+/**
+ * Remove a URL from the hotlist. This will be passed on to the core hotlist,
+ * unless we're configured to use external hotlists in which case we ignore it.
+ *
+ * \param *url The URL to be removed.
+ */
+
+void ro_gui_hotlist_remove_page(nsurl *url)
+{
+ if (url == NULL || nsoption_bool(external_hotlists) ||
+ !hotlist_has_url(url))
+ return;
+
+ /* Clean up any existing delete attempts before continuing. */
+
+ if (hotlist_query != QUERY_INVALID) {
+ query_close(hotlist_query);
+ hotlist_query = QUERY_INVALID;
+ }
+
+ if (hotlist_delete_url != NULL) {
+ nsurl_unref(hotlist_delete_url);
+ hotlist_delete_url = NULL;
+ }
+
+ /* Check with the user before removing the URL, unless they don't
+ * want us to be careful in which case just do it.
+ */
+
+ if (nsoption_bool(confirm_hotlist_remove)) {
+ hotlist_query = query_user("RemoveHotlist", NULL,
+ &remove_funcs, NULL,
+ messages_get("Remove"),
+ messages_get("DontRemove"));
+
+ hotlist_delete_url = nsurl_ref(url);
+ } else {
+ hotlist_remove_url(url);
+ ro_toolbar_update_all_hotlists();
+ }
+}
+
+
+/**
+ * Callback confirming a URL delete query.
+ *
+ * \param id The ID of the query calling us.
+ * \param res The user's response to the query.
+ * \param *p Callback data (always NULL).
+ */
+
+static void ro_gui_hotlist_remove_confirmed(query_id id,
+ enum query_response res, void *p)
+{
+ hotlist_remove_url(hotlist_delete_url);
+ ro_toolbar_update_all_hotlists();
+
+ nsurl_unref(hotlist_delete_url);
+ hotlist_delete_url = NULL;
+ hotlist_query = QUERY_INVALID;
+}
+
+
+/**
+ * Callback cancelling a URL delete query.
+ *
+ * \param id The ID of the query calling us.
+ * \param res The user's response to the query.
+ * \param *p Callback data (always NULL).
+ */
+
+static void ro_gui_hotlist_remove_cancelled(query_id id,
+ enum query_response res, void *p)
+{
+ nsurl_unref(hotlist_delete_url);
+ hotlist_delete_url = NULL;
+ hotlist_query = QUERY_INVALID;
+}
+
+
+/**
+ * Report whether the hotlist contains a given URL. This will be passed on to
+ * the core hotlist, unless we're configured to use an external hotlist in which
+ * case we always report false.
+ *
+ * \param *url The URL to be tested.
+ * \return true if the hotlist contains the URL; else false.
+ */
+
+bool ro_gui_hotlist_has_page(nsurl *url)
+{
+ if (url == NULL || nsoption_bool(external_hotlists))
+ return false;
+
+ return hotlist_has_url(url);
+}
+
+
#if 0
/**
* Handle URL dropped on hotlist
diff --git a/riscos/hotlist.h b/riscos/hotlist.h
index 25e4794..4cb5a1f 100644
--- a/riscos/hotlist.h
+++ b/riscos/hotlist.h
@@ -47,6 +47,8 @@ bool ro_gui_hotlist_check_window(wimp_w window);
bool ro_gui_hotlist_check_menu(wimp_menu *menu);
void ro_gui_hotlist_add_page(nsurl *url);
void ro_gui_hotlist_add_cleanup(void);
+void ro_gui_hotlist_remove_page(nsurl *url);
+bool ro_gui_hotlist_has_page(nsurl *url);
#endif
diff --git a/riscos/mouse.c b/riscos/mouse.c
index c655340..a20965e 100644
--- a/riscos/mouse.c
+++ b/riscos/mouse.c
@@ -50,6 +50,8 @@ static void (*ro_mouse_drag_track_callback)(wimp_pointer *pointer, void *data)
static void (*ro_mouse_drag_cancel_callback)(void *data) = NULL;
static void *ro_mouse_drag_data = NULL;
+static bool ro_mouse_ignore_leaving_event = false;
+
/* Data for the wimp poll handler. */
static void (*ro_mouse_poll_end_callback)(wimp_leaving *leaving, void *data)
@@ -123,6 +125,12 @@ void ro_mouse_drag_start(void (*drag_end)(wimp_dragged *dragged, void *data),
ro_mouse_drag_track_callback = drag_track;
ro_mouse_drag_cancel_callback = drag_cancel;
ro_mouse_drag_data = data;
+
+ /* The Wimp sends a PointerLeaving event when Wimp_DragBox is called,
+ * so we mask out the next event that will come our way.
+ */
+
+ ro_mouse_ignore_leaving_event = true;
}
@@ -184,14 +192,20 @@ void ro_mouse_track_start(void (*poll_end)(wimp_leaving *leaving, void *data),
* Process Wimp_PointerLeaving events by terminating an active mouse track and
* passing the details on to any registered event handler.
*
+ * If the ignore mask is set, we don't pass the event on to the client as it
+ * is assumed that it's a result of starting a Wimp_DragBox operation.
+ *
* \param *leaving The Wimp_PointerLeaving data block.
*/
void ro_mouse_pointer_leaving_window(wimp_leaving *leaving)
{
- if (ro_mouse_poll_end_callback != NULL)
+ if (ro_mouse_poll_end_callback != NULL &&
+ ro_mouse_ignore_leaving_event == false)
ro_mouse_poll_end_callback(leaving, ro_mouse_poll_data);
+ ro_mouse_ignore_leaving_event = false;
+
/* Poll tracking is a one-shot event, so clear the data ready for
* another claimant.
*/
diff --git a/riscos/options.h b/riscos/options.h
index 9ee3592..cb2b78b 100644
--- a/riscos/options.h
+++ b/riscos/options.h
@@ -53,6 +53,7 @@ NSOPTION_BOOL(no_plugins, false)
NSOPTION_BOOL(block_popups, false)
NSOPTION_BOOL(strip_extensions, false)
NSOPTION_BOOL(confirm_overwrite, true)
+NSOPTION_BOOL(confirm_hotlist_remove, true)
NSOPTION_STRING(url_path, "NetSurf:URL")
NSOPTION_STRING(url_save, CHOICES_PREFIX "URL")
NSOPTION_STRING(hotlist_path, "NetSurf:Hotlist")
diff --git a/riscos/toolbar.c b/riscos/toolbar.c
index 4da4db4..93c4438 100644
--- a/riscos/toolbar.c
+++ b/riscos/toolbar.c
@@ -162,7 +162,7 @@ static wimp_window ro_toolbar_window = {
wimp_WINDOW_NEVER3D | 0x16u /* RISC OS 5.03+ */,
{0, 0, TOOLBAR_DEFAULT_WIDTH, 16384},
0,
- wimp_BUTTON_CLICK_DRAG << wimp_ICON_BUTTON_TYPE_SHIFT,
+ wimp_BUTTON_DOUBLE_CLICK_DRAG << wimp_ICON_BUTTON_TYPE_SHIFT,
wimpspriteop_AREA,
1,
1,
@@ -1620,10 +1620,27 @@ const char *ro_toolbar_get_url(struct toolbar *toolbar)
/* This is an exported interface documented in toolbar.h */
-void ro_toolbar_hotlist_modifed(struct toolbar *toolbar, nsurl *url)
+void ro_toolbar_update_all_hotlists(void)
{
- if (toolbar != NULL && toolbar->url != NULL)
- ro_gui_url_bar_hotlist_modifed(toolbar->url, url);
+ struct toolbar *bar;
+
+ bar = ro_toolbar_bars;
+ while (bar != NULL) {
+ ro_toolbar_update_hotlist(bar);
+
+ bar = bar->next;
+ }
+}
+
+
+/* This is an exported interface documented in toolbar.h */
+
+void ro_toolbar_update_hotlist(struct toolbar *toolbar)
+{
+ if (toolbar == NULL || toolbar->url == NULL)
+ return;
+
+ ro_gui_url_bar_update_hotlist(toolbar->url);
}
diff --git a/riscos/toolbar.h b/riscos/toolbar.h
index 284eee2..336f95d 100644
--- a/riscos/toolbar.h
+++ b/riscos/toolbar.h
@@ -386,13 +386,20 @@ const char *ro_toolbar_get_url(struct toolbar *toolbar);
/**
- * Update toolbar's urlbar hotlist icon, if necessary.
+ * Update the state of the URL Bar hotlist icons in all open toolbars.
+ */
+
+void ro_toolbar_update_all_hotlists(void);
+
+
+/**
+ * Update the state of a toolbar's URL Bar hotlist icon to reflect any changes
+ * to the URL or the hotlist contents.
*
* \param *toolbar The toolbar to update.
- * \param *url URL with updated hotlist presence, or NULL if unknown.
*/
-void ro_toolbar_hotlist_modifed(struct toolbar *toolbar, nsurl *url);
+void ro_toolbar_update_hotlist(struct toolbar *toolbar);
/**
diff --git a/riscos/window.c b/riscos/window.c
index a7c42ac..f6b274a 100644
--- a/riscos/window.c
+++ b/riscos/window.c
@@ -138,6 +138,7 @@ static void ro_gui_window_action_save(struct gui_window *g,
static void ro_gui_window_action_search(struct gui_window *g);
static void ro_gui_window_action_zoom(struct gui_window *g);
static void ro_gui_window_action_add_bookmark(struct gui_window *g);
+static void ro_gui_window_action_remove_bookmark(struct gui_window *g);
static void ro_gui_window_action_print(struct gui_window *g);
static void ro_gui_window_action_page_info(struct gui_window *g);
@@ -3611,9 +3612,12 @@ void ro_gui_window_toolbar_click(void *data,
return;
- if (action_type == TOOLBAR_ACTION_URL &&
- action.url == TOOLBAR_URL_DRAG_URL) {
- if (g->bw->current_content) {
+ if (action_type == TOOLBAR_ACTION_URL) {
+ switch (action.url) {
+ case TOOLBAR_URL_DRAG_URL:
+ if (g->bw->current_content == NULL)
+ break;
+
hlcache_handle *h = g->bw->current_content;
if (ro_gui_shift_pressed())
@@ -3624,6 +3628,18 @@ void ro_gui_window_toolbar_click(void *data,
ro_gui_drag_save_link(save_type,
nsurl_access(hlcache_handle_get_url(h)),
content_get_title(h), g);
+ break;
+
+ case TOOLBAR_URL_SELECT_HOTLIST:
+ ro_gui_window_action_add_bookmark(g);
+ break;
+
+ case TOOLBAR_URL_ADJUST_HOTLIST:
+ ro_gui_window_action_remove_bookmark(g);
+ break;
+
+ default:
+ break;
}
return;
@@ -4250,7 +4266,7 @@ void ro_gui_window_action_zoom(struct gui_window *g)
* \param *g The browser window to act on.
*/
-void ro_gui_window_action_add_bookmark(struct gui_window *g)
+static void ro_gui_window_action_add_bookmark(struct gui_window *g)
{
nsurl *url;
@@ -4262,7 +4278,28 @@ void ro_gui_window_action_add_bookmark(struct gui_window *g)
url = hlcache_handle_get_url(g->bw->current_content);
ro_gui_hotlist_add_page(url);
- ro_toolbar_hotlist_modifed(g->toolbar, url);
+ ro_toolbar_update_hotlist(g->toolbar);
+}
+
+
+/**
+ * Remove a hotlist entry for a browser window.
+ *
+ * \param *g The browser window to act on.
+ */
+
+static void ro_gui_window_action_remove_bookmark(struct gui_window *g)
+{
+ nsurl *url;
+
+ if (g == NULL || g->bw == NULL || g->toolbar == NULL ||
+ g->bw->current_content == NULL ||
+ hlcache_handle_get_url(g->bw->current_content) == NULL)
+ return;
+
+ url = hlcache_handle_get_url(g->bw->current_content);
+
+ ro_gui_hotlist_remove_page(url);
}
--
NetSurf Browser
9 years