r10911 jmb - /trunk/netsurf/desktop/tree_url_node.c
by netsurfï¼ semichrome.net
Author: jmb
Date: Wed Oct 27 15:15:01 2010
New Revision: 10911
URL: http://source.netsurf-browser.org?rev=10911&view=rev
Log:
Fix bug 3095552: don't escape URLs after editing. (credit: Martin Bazley)
Modified:
trunk/netsurf/desktop/tree_url_node.c
Modified: trunk/netsurf/desktop/tree_url_node.c
URL: http://source.netsurf-browser.org/trunk/netsurf/desktop/tree_url_node.c?r...
==============================================================================
--- trunk/netsurf/desktop/tree_url_node.c (original)
+++ trunk/netsurf/desktop/tree_url_node.c Wed Oct 27 15:15:01 2010
@@ -360,7 +360,7 @@
struct node_element *element;
url_func_result res;
const char *text;
- char *norm_text, *escaped_text;
+ char *norm_text;
const struct url_data *data;
/** @todo memory leaks on non-shared folder deletion. */
@@ -400,11 +400,7 @@
text = msg_data->data.text;
if (msg_data->flag == TREE_ELEMENT_URL) {
- res = url_escape(text, 0, false, NULL,
- &escaped_text);
- if (res == URL_FUNC_OK)
- res = url_normalize(escaped_text,
- &norm_text);
+ res = url_normalize(text, &norm_text);
if (res != URL_FUNC_OK) {
if (res == URL_FUNC_FAILED) {
warn_user("NoURLError", 0);
12Â years, 7Â months
r10910 vince - in /trunk/netsurf: Makefile amiga/Makefile.target beos/Makefile.target framebuffer/Makefile.target gtk/Makefile.target riscos/Makefile.target windows/Makefile.target
by netsurfï¼ semichrome.net
Author: vince
Date: Wed Oct 27 13:39:24 2010
New Revision: 10910
URL: http://source.netsurf-browser.org?rev=10910&view=rev
Log:
Beginning of NetSurf build infrastructure cleanup
Provide makefile fragment for each target, isolates the target makefile changes into one place simplifying the top level makefile
Added:
trunk/netsurf/amiga/Makefile.target
trunk/netsurf/beos/Makefile.target
trunk/netsurf/framebuffer/Makefile.target
trunk/netsurf/gtk/Makefile.target
trunk/netsurf/riscos/Makefile.target
trunk/netsurf/windows/Makefile.target
Modified:
trunk/netsurf/Makefile
Modified: trunk/netsurf/Makefile
URL: http://source.netsurf-browser.org/trunk/netsurf/Makefile?rev=10910&r1=109...
==============================================================================
--- trunk/netsurf/Makefile (original)
+++ trunk/netsurf/Makefile Wed Oct 27 13:39:24 2010
@@ -191,21 +191,6 @@
OBJROOT = build-$(HOST)-$(TARGET)$(SUBTARGET)
-# ----------------------------------------------------------------------------
-# General flag setup
-# ----------------------------------------------------------------------------
-
-# Set up the WARNFLAGS here so that they can be overridden in the Makefile.config
-WARNFLAGS = -W -Wall -Wundef -Wpointer-arith \
- -Wcast-align -Wwrite-strings -Wstrict-prototypes \
- -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls \
- -Wnested-externs
-ifneq ($(GCCVER),2)
- WARNFLAGS += -Wno-unused-parameter
-endif
-
-# Pull in the configuration
-include Makefile.defaults
# 1: Feature name (ie, NETSURF_USE_BMP -> BMP)
# 2: Parameters to add to CFLAGS
@@ -271,6 +256,22 @@
endif
endef
+# ----------------------------------------------------------------------------
+# General flag setup
+# ----------------------------------------------------------------------------
+
+# Set up the WARNFLAGS here so that they can be overridden in the Makefile.config
+WARNFLAGS = -W -Wall -Wundef -Wpointer-arith \
+ -Wcast-align -Wwrite-strings -Wstrict-prototypes \
+ -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls \
+ -Wnested-externs
+ifneq ($(GCCVER),2)
+ WARNFLAGS += -Wno-unused-parameter
+endif
+
+# Pull in the configuration
+include Makefile.defaults
+
$(eval $(call feature_enabled,JPEG,-DWITH_JPEG,-ljpeg,JPEG (libjpeg)))
$(eval $(call feature_enabled,MNG,-DWITH_MNG,-lmng,JNG/MNG/PNG (libmng)))
@@ -284,337 +285,10 @@
CFLAGS += -DNETSURF_HOMEPAGE=\"$(NETSURF_HOMEPAGE)\"
# ----------------------------------------------------------------------------
-# RISC OS target setup
+# Target specific setup
# ----------------------------------------------------------------------------
-ifeq ($(TARGET),riscos)
- ifeq ($(HOST),riscos)
- LDFLAGS += -Xlinker -symbols=$(OBJROOT)/sym -lxml2 -lz -lm -lcurl -lcares
- LDFLAGS += -lssl -lcrypto -lhubbub -lcss -lparserutils -lwapcaplet
- else
- LDFLAGS += $(shell $(PKG_CONFIG) --libs libxml-2.0 libcares libcurl openssl)
- LDFLAGS += $(shell $(PKG_CONFIG) --libs libhubbub libcss)
- endif
-
- $(eval $(call feature_enabled,NSSVG,-DWITH_NS_SVG,-lsvgtiny,SVG (libsvgtiny)))
- $(eval $(call feature_enabled,DRAW,-DWITH_DRAW,,Drawfile rendering))
- $(eval $(call feature_enabled,SPRITE,-DWITH_SPRITE,,Sprite rendering))
- $(eval $(call feature_enabled,ARTWORKS,-DWITH_ARTWORKS,,ArtWorks rendering))
- $(eval $(call feature_enabled,PLUGINS,-DWITH_PLUGIN,,Plugin protocol))
- $(eval $(call feature_enabled,DRAW_EXPORT,-DWITH_DRAW_EXPORT,-lpencil,Drawfile export))
- ifeq ($(HOST),riscos)
- $(eval $(call feature_enabled,BMP,-DWITH_BMP,-lnsbmp,BMP (libnsbmp)))
- $(eval $(call feature_enabled,GIF,-DWITH_GIF,-lnsgif,GIF (libnsgif)))
- $(eval $(call feature_enabled,PNG,-DWITH_PNG,-lpng,PNG (libpng) ))
- else
- NETSURF_FEATURE_BMP_CFLAGS := -DWITH_BMP
- NETSURF_FEATURE_GIF_CFLAGS := -DWITH_GIF
- NETSURF_FEATURE_PNG_CFLAGS := -DWITH_PNG
- $(eval $(call pkg_config_find_and_add,BMP,libnsbmp,BMP))
- $(eval $(call pkg_config_find_and_add,GIF,libnsgif,GIF))
- $(eval $(call pkg_config_find_and_add,PNG,libpng,PNG ))
- endif
-
- TPD_RISCOS = $(foreach TPL,$(notdir $(TPL_RISCOS)), \
- !NetSurf/Resources/$(TPL)/Templates$(TPLEXT))
-
- RESOURCES = $(TPD_RISCOS)
-
- CFLAGS += -I. $(WARNFLAGS) -Driscos \
- -std=c99 -D_BSD_SOURCE -D_POSIX_C_SOURCE \
- -mpoke-function-name -fno-strict-aliasing
-
- CFLAGS += -I$(GCCSDK_INSTALL_ENV)/include \
- -I$(GCCSDK_INSTALL_ENV)/include/libxml2 \
- -I$(GCCSDK_INSTALL_ENV)/include/libmng
- ifeq ($(HOST),riscos)
- CFLAGS += -I<OSLib$$Dir> -mthrowback
- endif
- ASFLAGS += -xassembler-with-cpp -I. -I$(GCCSDK_INSTALL_ENV)/include
- LDFLAGS += -L$(GCCSDK_INSTALL_ENV)/lib -lrufl
- ifeq ($(HOST),riscos)
- LDFLAGS += -LOSLib: -lOSLib32
- else
- LDFLAGS += -lOSLib32
- ifeq ($(SUBTARGET),-elf)
- # Go for static builds & AIF binary at the moment:
- CFLAGS += -static
- LDFLAGS += -static
- EXEEXT := ,ff8
- endif
- endif
-endif
-
-# ----------------------------------------------------------------------------
-# BeOS target setup
-# ----------------------------------------------------------------------------
-
-ifeq ($(TARGET),beos)
- $(eval $(call feature_enabled,PNG,-DWITH_PNG,-lpng,PNG (libpng) ))
-
- LDFLAGS += -L/boot/home/config/lib
- # for Haiku
- LDFLAGS += -L/boot/common/lib
- # some people do *not* have libm...
- LDFLAGS += -lxml2 -lcurl -liconv
- LDFLAGS += -lssl -lcrypto -lhubbub -lcss -lparserutils -lwapcaplet
-
- CFLAGS += -I. -O $(WARNFLAGS) -Dnsbeos \
- -D_BSD_SOURCE -D_POSIX_C_SOURCE \
- -Drestrict="" -Wno-multichar
- # DEBUG
- CFLAGS += -g -O0
- # -DDEBUG=1
-
- BEOS_BERES := beres
- BEOS_RC := rc
- BEOS_XRES := xres
- BEOS_SETVER := setversion
- BEOS_MIMESET := mimeset
- VERSION_FULL := $(shell sed -n '/"/{s/.*"\(.*\)".*/\1/;p;}' desktop/version.c)
- VERSION_MAJ := $(shell sed -n '/_major/{s/.* = \([0-9]*\).*/\1/;p;}' desktop/version.c)
- VERSION_MIN := $(shell sed -n '/_minor/{s/.* = \([0-9]*\).*/\1/;p;}' desktop/version.c)
- RSRC_BEOS = $(addprefix $(OBJROOT)/,$(subst /,_,$(patsubst %.rdef,%.rsrc,$(RDEF_BEOS))))
- RESOURCES = $(RSRC_BEOS)
- ifeq ($(HOST),beos)
- CFLAGS += -I/boot/home/config/include \
- -I/boot/home/config/include/libxml2 \
- -I/boot/home/config/include/libmng \
- -I/boot/home/config/include/hubbub \
- -I/boot/home/config/include/libcss \
- -I/boot/home/config/include/parserutils
- ifneq ($(wildcard /boot/develop/lib/*/libzeta.so),)
- LDFLAGS += -lzeta
- endif
- ifneq ($(wildcard /boot/develop/lib/*/libnetwork.so),)
- # Haiku
- CFLAGS += -I/boot/common/include \
- -I/boot/common/include/libxml2 \
- -I/boot/common/include/libmng \
- -I/boot/common/include/hubbub \
- -I/boot/common/include/libcss \
- -I/boot/common/include/parserutils
- NETLDFLAGS := -lnetwork
- else
- ifneq ($(wildcard /boot/develop/lib/*/libbind.so),)
- # BONE
- NETLDFLAGS := -lsocket -lbind
- else
- # net_server, will probably never work
- NETLDFLAGS := -lnet
- endif
- endif
- else
- # cross: Haiku ?
- NETLDFLAGS := -lnetwork
- endif
- LDFLAGS += -lbe -ltranslation $(NETLDFLAGS)
-
- $(eval $(call feature_enabled,NSSVG,-DWITH_NS_SVG,-lsvgtiny,SVG (libsvgtiny)))
- ifeq ($(HOST),beos)
- CFLAGS += -I$(PREFIX)/include
- LDFLAGS += -L$(PREFIX)/lib
- $(eval $(call feature_enabled,BMP,-DWITH_BMP,-lnsbmp,BMP (libnsbmp)))
- $(eval $(call feature_enabled,GIF,-DWITH_GIF,-lnsgif,GIF (libnsgif)))
- $(eval $(call feature_enabled,PNG,-DWITH_PNG,-lpng,PNG (libpng) ))
- else
- NETSURF_FEATURE_BMP_CFLAGS := -DWITH_BMP
- NETSURF_FEATURE_GIF_CFLAGS := -DWITH_GIF
- NETSURF_FEATURE_PNG_CFLAGS := -DWITH_PNG
- $(eval $(call pkg_config_find_and_add,BMP,libnsbmp,BMP))
- $(eval $(call pkg_config_find_and_add,GIF,libnsgif,GIF))
- $(eval $(call pkg_config_find_and_add,PNG,libpng,PNG ))
- endif
-endif
-
-# ----------------------------------------------------------------------------
-# GTK flag setup (using pkg-config)
-# ----------------------------------------------------------------------------
-
-ifeq ($(TARGET),gtk)
- LDFLAGS += $(shell $(PKG_CONFIG) --libs libxml-2.0 libcurl libhubbub libcss)
- LDFLAGS += $(shell $(PKG_CONFIG) --libs openssl)
-
- # define additional CFLAGS and LDFLAGS requirements for pkg-configed libs here
- NETSURF_FEATURE_RSVG_CFLAGS := -DWITH_RSVG
- NETSURF_FEATURE_NSSVG_CFLAGS := -DWITH_NS_SVG
- NETSURF_FEATURE_ROSPRITE_CFLAGS := -DWITH_NSSPRITE
- NETSURF_FEATURE_BMP_CFLAGS := -DWITH_BMP
- NETSURF_FEATURE_GIF_CFLAGS := -DWITH_GIF
- NETSURF_FEATURE_PNG_CFLAGS := -DWITH_PNG
- NETSURF_FEATURE_WEBP_CFLAGS := -DWITH_WEBP
-
- # add a line similar to below for each optional pkg-configed lib here
- $(eval $(call pkg_config_find_and_add,RSVG,librsvg-2.0,SVG))
- $(eval $(call pkg_config_find_and_add,NSSVG,libsvgtiny,SVG))
- $(eval $(call pkg_config_find_and_add,ROSPRITE,librosprite,Sprite))
- $(eval $(call pkg_config_find_and_add,BMP,libnsbmp,BMP))
- $(eval $(call pkg_config_find_and_add,GIF,libnsgif,GIF))
- $(eval $(call pkg_config_find_and_add,PNG,libpng,PNG ))
-
- # no pkg-config for this library
- $(eval $(call feature_enabled,WEBP,-DWITH_WEBP,-lwebp -lvpx,WebP (libwebp)))
-
- GTKCFLAGS := -std=c99 -Dgtk -Dnsgtk \
- -DGTK_DISABLE_DEPRECATED \
- -D_BSD_SOURCE \
- -D_XOPEN_SOURCE=600 \
- -D_POSIX_C_SOURCE=200112L \
- -D_NETBSD_SOURCE \
- -DGTK_RESPATH=\"$(NETSURF_GTK_RESOURCES)\" \
- $(WARNFLAGS) -I. -g \
- $(shell $(PKG_CONFIG) --cflags libglade-2.0 gtk+-2.0) \
- $(shell $(PKG_CONFIG) --cflags libhubbub libcurl) \
- $(shell $(PKG_CONFIG) --cflags openssl) \
- $(shell xml2-config --cflags)
-
- GTKLDFLAGS := $(shell $(PKG_CONFIG) --cflags --libs libglade-2.0 gtk+-2.0 gthread-2.0 gmodule-2.0 lcms)
-
- CFLAGS += $(GTKCFLAGS)
- LDFLAGS += $(GTKLDFLAGS)
-
- # ---------------------------------------------------------------------------
- # Windows flag setup
- # ---------------------------------------------------------------------------
-
- ifeq ($(HOST),Windows_NT)
- CFLAGS += -U__STRICT_ANSI__
- endif
-endif
-
-# ----------------------------------------------------------------------------
-# Windows target setup
-# ----------------------------------------------------------------------------
-ifeq ($(TARGET),windows)
- NETSURF_FEATURE_NSSVG_CFLAGS := -DWITH_NS_SVG
- NETSURF_FEATURE_ROSPRITE_CFLAGS := -DWITH_NSSPRITE
- NETSURF_FEATURE_BMP_CFLAGS := -DWITH_BMP
- NETSURF_FEATURE_GIF_CFLAGS := -DWITH_GIF
- NETSURF_FEATURE_PNG_CFLAGS := -DWITH_PNG
- $(eval $(call feature_enabled,BMP,-DWITH_BMP,-lnsbmp,BMP (libnsbmp)))
- $(eval $(call feature_enabled,GIF,-DWITH_GIF,-lnsgif,GIF (libnsgif)))
- $(eval $(call feature_enabled,PNG,-DWITH_PNG,-lpng,PNG (libpng) ))
- $(eval $(call feature_enabled,NSSVG,-DWITH_NS_SVG,-lsvgtiny,SVG (libsvgtiny)))
- $(eval $(call feature_enabled,MNG,,-llcms -ljpeg,PNG/JNG/MNG (libmng)))
-
- LDFLAGS += -L${MINGW_INSTALL_ENV}/lib $(shell $(PKG_CONFIG) --libs zlib \
- libxml-2.0 libcurl libhubbub libparserutils libcss libwapcaplet) \
- -lparserutils -lssl -lcrypto -lregex -liconv -lcss -lwapcaplet \
- -lgdi32 -lcomctl32 -lws2_32 -lmsimg32 -mwindows
- CFLAGS += -U__STRICT_ANSI__ -mwin32
- # only windows versions after 2000 are supported
- CFLAGS += '-DWINVER=0x0500'
- WSCFLAGS := -std=c99 \
- $(WARNFLAGS) -I. -I/${MINGW_INSTALL_ENV}/include \
- -DCURL_STATICLIB \
- $(shell $(PKG_CONFIG) --cflags libcurl libhubbub zlib libparserutils \
- libxml-2.0) -g
- CFLAGS += $(WSCFLAGS)
- LDFLAGS += $(WSCFLAGS)
-endif
-
-# ----------------------------------------------------------------------------
-# Amiga target setup
-# ----------------------------------------------------------------------------
-
-ifeq ($(TARGET),amiga)
- NETSURF_FEATURE_ROSPRITE_CFLAGS := -DWITH_NSSPRITE
- NETSURF_FEATURE_BMP_CFLAGS := -DWITH_BMP
- NETSURF_FEATURE_GIF_CFLAGS := -DWITH_GIF
- NETSURF_FEATURE_PNG_CFLAGS := -DWITH_PNG
- NETSURF_FEATURE_WEBP_CFLAGS := -DWITH_WEBP
- NETSURF_FEATURE_NSSVG_CFLAGS := -DWITH_NS_SVG
-
- $(eval $(call feature_enabled,ROSPRITE,-DWITH_NSSPRITE,-lrosprite,Sprite (librosprite)))
- $(eval $(call feature_enabled,BMP,-DWITH_BMP,-lnsbmp,BMP (libnsbmp)))
- $(eval $(call feature_enabled,GIF,-DWITH_GIF,-lnsgif,GIF (libnsgif)))
- $(eval $(call feature_enabled,PNG,-DWITH_PNG,-lpng,PNG (libpng) ))
- $(eval $(call feature_enabled,NSSVG,-DWITH_NS_SVG,-lsvgtiny,SVG (libsvgtiny)))
- $(eval $(call feature_enabled,MNG,,-llcms -ljpeg,PNG/JNG/MNG (libmng)))
- $(eval $(call feature_enabled,WEBP,-DWITH_WEBP,-lwebp -lvpx,WebP (libwebp)))
-
- CFLAGS += -D__USE_INLINE__ -std=c99 -I . -I /SDK/local/common/include/libpng12 -Dnsamiga
- LDFLAGS += -lxml2 -lcurl -lpthread -lregex -lauto
- LDFLAGS += -lssl -lcrypto -lhubbub -lcss -lparserutils -lwapcaplet -liconv
-
- ifeq ($(NETSURF_AMIGA_USE_CAIRO),YES)
- CFLAGS += -DNS_AMIGA_CAIRO -I /SDK/local/common/include/cairo
- LDFLAGS += -use-dynld -ldl -lcairo -lpixman-1 -lfreetype -lfontconfig -lpng -lexpat
- SUBTARGET := -cairo
- endif
-endif
-
-# ----------------------------------------------------------------------------
-# Framebuffer target setup
-# ----------------------------------------------------------------------------
-
-ifeq ($(TARGET),framebuffer)
-
- $(eval $(call feature_enabled,MNG,-DWITH_MNG,-lmng,PNG/MNG/JNG (libmng)))
- $(eval $(call feature_enabled,PNG,-DWITH_PNG,-lpng,PNG (libpng) ))
-
- ifeq ($(NETSURF_FB_FONTLIB),freetype)
- CFLAGS += -DFB_USE_FREETYPE $(shell freetype-config --cflags)
- LDFLAGS += $(shell freetype-config --libs)
- endif
-
- # define additional CFLAGS and LDFLAGS requirements for pkg-configed libs here
- NETSURF_FEATURE_RSVG_CFLAGS := -DWITH_RSVG
- NETSURF_FEATURE_ROSPRITE_CFLAGS := -DWITH_NSSPRITE
- NETSURF_FEATURE_HUBBUB_CFLAGS := -DWITH_HUBBUB
- NETSURF_FEATURE_BMP_CFLAGS := -DWITH_BMP
- NETSURF_FEATURE_GIF_CFLAGS := -DWITH_GIF
-
- CFLAGS += -Dnsframebuffer
-
- #resource path
- CFLAGS += '-DNETSURF_FB_RESPATH="$(NETSURF_FB_RESPATH_$(NETSURF_FB_FRONTEND))"'
-
- # compile time font locations
- CFLAGS += '-DNETSURF_FB_FONT_SANS_SERIF="$(NETSURF_FB_FONT_SANS_SERIF)"'
- CFLAGS += '-DNETSURF_FB_FONT_SANS_SERIF_BOLD="$(NETSURF_FB_FONT_SANS_SERIF_BOLD)"'
- CFLAGS += '-DNETSURF_FB_FONT_SANS_SERIF_ITALIC="$(NETSURF_FB_FONT_SANS_SERIF_ITALIC)"'
- CFLAGS += '-DNETSURF_FB_FONT_SANS_SERIF_ITALIC_BOLD="$(NETSURF_FB_FONT_SANS_SERIF_ITALIC_BOLD)"'
- CFLAGS += '-DNETSURF_FB_FONT_SERIF="$(NETSURF_FB_FONT_SERIF)"'
- CFLAGS += '-DNETSURF_FB_FONT_SERIF_BOLD="$(NETSURF_FB_FONT_SERIF_BOLD)"'
- CFLAGS += '-DNETSURF_FB_FONT_MONOSPACE="$(NETSURF_FB_FONT_MONOSPACE)"'
- CFLAGS += '-DNETSURF_FB_FONT_MONOSPACE_BOLD="$(NETSURF_FB_FONT_MONOSPACE_BOLD)"'
- CFLAGS += '-DNETSURF_FB_FONT_CURSIVE="$(NETSURF_FB_FONT_CURSIVE)"'
- CFLAGS += '-DNETSURF_FB_FONT_FANTASY="$(NETSURF_FB_FONT_FANTASY)"'
-
- $(eval $(call pkg_config_find_and_add,ROSPRITE,librosprite,Sprite))
- $(eval $(call pkg_config_find_and_add,BMP,libnsbmp,BMP))
- $(eval $(call pkg_config_find_and_add,GIF,libnsgif,GIF))
-
- CFLAGS += -std=c99 -g -I. -Dsmall $(WARNFLAGS) \
- -D_BSD_SOURCE \
- -D_XOPEN_SOURCE=600 \
- -D_POSIX_C_SOURCE=200112L \
- $(shell $(PKG_CONFIG) --cflags libnsfb libhubbub libcss openssl) \
- $(shell xml2-config --cflags)
-
- ifeq ($(HOST),mint)
- # freemint does not support pkg-config for libcurl
- CFLAGS += $(shell curl-config --cflags)
- else
- CFLAGS += $(shell $(PKG_CONFIG) --cflags libcurl)
- endif
-
- LDFLAGS += -Wl,--whole-archive $(shell $(PKG_CONFIG) --libs libnsfb) -Wl,--no-whole-archive
-
- ifeq ($(HOST),mint)
- LDFLAGS += $(shell curl-config --libs)
- LDFLAGS += $(shell $(PKG_CONFIG) --libs libhubbub openssl libcss)
- # xml-config returns -lsocket which is not needed and does not exist on all systems.
- # because of that - hardcoded reference to libxml-2.0 here.
- LDFLAGS += -L/usr/lib/ -lxml2 -lz -liconv
- LDFLAGS += -lm
- else
- LDFLAGS += $(shell $(PKG_CONFIG) --libs libxml-2.0 libcurl libhubbub openssl)
- LDFLAGS += $(shell $(PKG_CONFIG) --libs libcss)
- endif
-
-endif
+include $(TARGET)/Makefile.target
# ----------------------------------------------------------------------------
# General make rules
Added: trunk/netsurf/amiga/Makefile.target
URL: http://source.netsurf-browser.org/trunk/netsurf/amiga/Makefile.target?rev...
==============================================================================
--- trunk/netsurf/amiga/Makefile.target (added)
+++ trunk/netsurf/amiga/Makefile.target Wed Oct 27 13:39:24 2010
@@ -1,0 +1,30 @@
+# ----------------------------------------------------------------------------
+# Amiga target setup
+# ----------------------------------------------------------------------------
+
+
+ NETSURF_FEATURE_ROSPRITE_CFLAGS := -DWITH_NSSPRITE
+ NETSURF_FEATURE_BMP_CFLAGS := -DWITH_BMP
+ NETSURF_FEATURE_GIF_CFLAGS := -DWITH_GIF
+ NETSURF_FEATURE_PNG_CFLAGS := -DWITH_PNG
+ NETSURF_FEATURE_WEBP_CFLAGS := -DWITH_WEBP
+ NETSURF_FEATURE_NSSVG_CFLAGS := -DWITH_NS_SVG
+
+ $(eval $(call feature_enabled,ROSPRITE,-DWITH_NSSPRITE,-lrosprite,Sprite (librosprite)))
+ $(eval $(call feature_enabled,BMP,-DWITH_BMP,-lnsbmp,BMP (libnsbmp)))
+ $(eval $(call feature_enabled,GIF,-DWITH_GIF,-lnsgif,GIF (libnsgif)))
+ $(eval $(call feature_enabled,PNG,-DWITH_PNG,-lpng,PNG (libpng) ))
+ $(eval $(call feature_enabled,NSSVG,-DWITH_NS_SVG,-lsvgtiny,SVG (libsvgtiny)))
+ $(eval $(call feature_enabled,MNG,,-llcms -ljpeg,PNG/JNG/MNG (libmng)))
+ $(eval $(call feature_enabled,WEBP,-DWITH_WEBP,-lwebp -lvpx,WebP (libwebp)))
+
+ CFLAGS += -D__USE_INLINE__ -std=c99 -I . -I /SDK/local/common/include/libpng12 -Dnsamiga
+ LDFLAGS += -lxml2 -lcurl -lpthread -lregex -lauto
+ LDFLAGS += -lssl -lcrypto -lhubbub -lcss -lparserutils -lwapcaplet -liconv
+
+ ifeq ($(NETSURF_AMIGA_USE_CAIRO),YES)
+ CFLAGS += -DNS_AMIGA_CAIRO -I /SDK/local/common/include/cairo
+ LDFLAGS += -use-dynld -ldl -lcairo -lpixman-1 -lfreetype -lfontconfig -lpng -lexpat
+ SUBTARGET := -cairo
+ endif
+
Added: trunk/netsurf/beos/Makefile.target
URL: http://source.netsurf-browser.org/trunk/netsurf/beos/Makefile.target?rev=...
==============================================================================
--- trunk/netsurf/beos/Makefile.target (added)
+++ trunk/netsurf/beos/Makefile.target Wed Oct 27 13:39:24 2010
@@ -1,0 +1,81 @@
+# ----------------------------------------------------------------------------
+# BeOS target setup
+# ----------------------------------------------------------------------------
+
+
+ $(eval $(call feature_enabled,PNG,-DWITH_PNG,-lpng,PNG (libpng) ))
+
+ LDFLAGS += -L/boot/home/config/lib
+ # for Haiku
+ LDFLAGS += -L/boot/common/lib
+ # some people do *not* have libm...
+ LDFLAGS += -lxml2 -lcurl -liconv
+ LDFLAGS += -lssl -lcrypto -lhubbub -lcss -lparserutils -lwapcaplet
+
+ CFLAGS += -I. -O $(WARNFLAGS) -Dnsbeos \
+ -D_BSD_SOURCE -D_POSIX_C_SOURCE \
+ -Drestrict="" -Wno-multichar
+ # DEBUG
+ CFLAGS += -g -O0
+ # -DDEBUG=1
+
+ BEOS_BERES := beres
+ BEOS_RC := rc
+ BEOS_XRES := xres
+ BEOS_SETVER := setversion
+ BEOS_MIMESET := mimeset
+ VERSION_FULL := $(shell sed -n '/"/{s/.*"\(.*\)".*/\1/;p;}' desktop/version.c)
+ VERSION_MAJ := $(shell sed -n '/_major/{s/.* = \([0-9]*\).*/\1/;p;}' desktop/version.c)
+ VERSION_MIN := $(shell sed -n '/_minor/{s/.* = \([0-9]*\).*/\1/;p;}' desktop/version.c)
+ RSRC_BEOS = $(addprefix $(OBJROOT)/,$(subst /,_,$(patsubst %.rdef,%.rsrc,$(RDEF_BEOS))))
+ RESOURCES = $(RSRC_BEOS)
+ ifeq ($(HOST),beos)
+ CFLAGS += -I/boot/home/config/include \
+ -I/boot/home/config/include/libxml2 \
+ -I/boot/home/config/include/libmng \
+ -I/boot/home/config/include/hubbub \
+ -I/boot/home/config/include/libcss \
+ -I/boot/home/config/include/parserutils
+ ifneq ($(wildcard /boot/develop/lib/*/libzeta.so),)
+ LDFLAGS += -lzeta
+ endif
+ ifneq ($(wildcard /boot/develop/lib/*/libnetwork.so),)
+ # Haiku
+ CFLAGS += -I/boot/common/include \
+ -I/boot/common/include/libxml2 \
+ -I/boot/common/include/libmng \
+ -I/boot/common/include/hubbub \
+ -I/boot/common/include/libcss \
+ -I/boot/common/include/parserutils
+ NETLDFLAGS := -lnetwork
+ else
+ ifneq ($(wildcard /boot/develop/lib/*/libbind.so),)
+ # BONE
+ NETLDFLAGS := -lsocket -lbind
+ else
+ # net_server, will probably never work
+ NETLDFLAGS := -lnet
+ endif
+ endif
+ else
+ # cross: Haiku ?
+ NETLDFLAGS := -lnetwork
+ endif
+ LDFLAGS += -lbe -ltranslation $(NETLDFLAGS)
+
+ $(eval $(call feature_enabled,NSSVG,-DWITH_NS_SVG,-lsvgtiny,SVG (libsvgtiny)))
+ ifeq ($(HOST),beos)
+ CFLAGS += -I$(PREFIX)/include
+ LDFLAGS += -L$(PREFIX)/lib
+ $(eval $(call feature_enabled,BMP,-DWITH_BMP,-lnsbmp,BMP (libnsbmp)))
+ $(eval $(call feature_enabled,GIF,-DWITH_GIF,-lnsgif,GIF (libnsgif)))
+ $(eval $(call feature_enabled,PNG,-DWITH_PNG,-lpng,PNG (libpng) ))
+ else
+ NETSURF_FEATURE_BMP_CFLAGS := -DWITH_BMP
+ NETSURF_FEATURE_GIF_CFLAGS := -DWITH_GIF
+ NETSURF_FEATURE_PNG_CFLAGS := -DWITH_PNG
+ $(eval $(call pkg_config_find_and_add,BMP,libnsbmp,BMP))
+ $(eval $(call pkg_config_find_and_add,GIF,libnsgif,GIF))
+ $(eval $(call pkg_config_find_and_add,PNG,libpng,PNG ))
+ endif
+
Added: trunk/netsurf/framebuffer/Makefile.target
URL: http://source.netsurf-browser.org/trunk/netsurf/framebuffer/Makefile.targ...
==============================================================================
--- trunk/netsurf/framebuffer/Makefile.target (added)
+++ trunk/netsurf/framebuffer/Makefile.target Wed Oct 27 13:39:24 2010
@@ -1,0 +1,69 @@
+# ----------------------------------------------------------------------------
+# Framebuffer target setup
+# ----------------------------------------------------------------------------
+
+
+
+ $(eval $(call feature_enabled,MNG,-DWITH_MNG,-lmng,PNG/MNG/JNG (libmng)))
+ $(eval $(call feature_enabled,PNG,-DWITH_PNG,-lpng,PNG (libpng) ))
+
+ ifeq ($(NETSURF_FB_FONTLIB),freetype)
+ CFLAGS += -DFB_USE_FREETYPE $(shell freetype-config --cflags)
+ LDFLAGS += $(shell freetype-config --libs)
+ endif
+
+ # define additional CFLAGS and LDFLAGS requirements for pkg-configed libs here
+ NETSURF_FEATURE_RSVG_CFLAGS := -DWITH_RSVG
+ NETSURF_FEATURE_ROSPRITE_CFLAGS := -DWITH_NSSPRITE
+ NETSURF_FEATURE_HUBBUB_CFLAGS := -DWITH_HUBBUB
+ NETSURF_FEATURE_BMP_CFLAGS := -DWITH_BMP
+ NETSURF_FEATURE_GIF_CFLAGS := -DWITH_GIF
+
+ CFLAGS += -Dnsframebuffer
+
+ #resource path
+ CFLAGS += '-DNETSURF_FB_RESPATH="$(NETSURF_FB_RESPATH_$(NETSURF_FB_FRONTEND))"'
+
+ # compile time font locations
+ CFLAGS += '-DNETSURF_FB_FONT_SANS_SERIF="$(NETSURF_FB_FONT_SANS_SERIF)"'
+ CFLAGS += '-DNETSURF_FB_FONT_SANS_SERIF_BOLD="$(NETSURF_FB_FONT_SANS_SERIF_BOLD)"'
+ CFLAGS += '-DNETSURF_FB_FONT_SANS_SERIF_ITALIC="$(NETSURF_FB_FONT_SANS_SERIF_ITALIC)"'
+ CFLAGS += '-DNETSURF_FB_FONT_SANS_SERIF_ITALIC_BOLD="$(NETSURF_FB_FONT_SANS_SERIF_ITALIC_BOLD)"'
+ CFLAGS += '-DNETSURF_FB_FONT_SERIF="$(NETSURF_FB_FONT_SERIF)"'
+ CFLAGS += '-DNETSURF_FB_FONT_SERIF_BOLD="$(NETSURF_FB_FONT_SERIF_BOLD)"'
+ CFLAGS += '-DNETSURF_FB_FONT_MONOSPACE="$(NETSURF_FB_FONT_MONOSPACE)"'
+ CFLAGS += '-DNETSURF_FB_FONT_MONOSPACE_BOLD="$(NETSURF_FB_FONT_MONOSPACE_BOLD)"'
+ CFLAGS += '-DNETSURF_FB_FONT_CURSIVE="$(NETSURF_FB_FONT_CURSIVE)"'
+ CFLAGS += '-DNETSURF_FB_FONT_FANTASY="$(NETSURF_FB_FONT_FANTASY)"'
+
+ $(eval $(call pkg_config_find_and_add,ROSPRITE,librosprite,Sprite))
+ $(eval $(call pkg_config_find_and_add,BMP,libnsbmp,BMP))
+ $(eval $(call pkg_config_find_and_add,GIF,libnsgif,GIF))
+
+ CFLAGS += -std=c99 -g -I. -Dsmall $(WARNFLAGS) \
+ -D_BSD_SOURCE \
+ -D_XOPEN_SOURCE=600 \
+ -D_POSIX_C_SOURCE=200112L \
+ $(shell $(PKG_CONFIG) --cflags libnsfb libhubbub libcss openssl) \
+ $(shell xml2-config --cflags)
+
+ ifeq ($(HOST),mint)
+ # freemint does not support pkg-config for libcurl
+ CFLAGS += $(shell curl-config --cflags)
+ else
+ CFLAGS += $(shell $(PKG_CONFIG) --cflags libcurl)
+ endif
+
+ LDFLAGS += -Wl,--whole-archive $(shell $(PKG_CONFIG) --libs libnsfb) -Wl,--no-whole-archive
+
+ ifeq ($(HOST),mint)
+ LDFLAGS += $(shell curl-config --libs)
+ LDFLAGS += $(shell $(PKG_CONFIG) --libs libhubbub openssl libcss)
+ # xml-config returns -lsocket which is not needed and does not exist on all systems.
+ # because of that - hardcoded reference to libxml-2.0 here.
+ LDFLAGS += -L/usr/lib/ -lxml2 -lz -liconv
+ LDFLAGS += -lm
+ else
+ LDFLAGS += $(shell $(PKG_CONFIG) --libs libxml-2.0 libcurl libhubbub openssl)
+ LDFLAGS += $(shell $(PKG_CONFIG) --libs libcss)
+ endif
Added: trunk/netsurf/gtk/Makefile.target
URL: http://source.netsurf-browser.org/trunk/netsurf/gtk/Makefile.target?rev=1...
==============================================================================
--- trunk/netsurf/gtk/Makefile.target (added)
+++ trunk/netsurf/gtk/Makefile.target Wed Oct 27 13:39:24 2010
@@ -1,0 +1,54 @@
+# ----------------------------------------------------------------------------
+# GTK flag setup (using pkg-config)
+# ----------------------------------------------------------------------------
+
+
+ LDFLAGS += $(shell $(PKG_CONFIG) --libs libxml-2.0 libcurl libhubbub libcss)
+ LDFLAGS += $(shell $(PKG_CONFIG) --libs openssl)
+
+ # define additional CFLAGS and LDFLAGS requirements for pkg-configed libs here
+ NETSURF_FEATURE_RSVG_CFLAGS := -DWITH_RSVG
+ NETSURF_FEATURE_NSSVG_CFLAGS := -DWITH_NS_SVG
+ NETSURF_FEATURE_ROSPRITE_CFLAGS := -DWITH_NSSPRITE
+ NETSURF_FEATURE_BMP_CFLAGS := -DWITH_BMP
+ NETSURF_FEATURE_GIF_CFLAGS := -DWITH_GIF
+ NETSURF_FEATURE_PNG_CFLAGS := -DWITH_PNG
+ NETSURF_FEATURE_WEBP_CFLAGS := -DWITH_WEBP
+
+ # add a line similar to below for each optional pkg-configed lib here
+ $(eval $(call pkg_config_find_and_add,RSVG,librsvg-2.0,SVG))
+ $(eval $(call pkg_config_find_and_add,NSSVG,libsvgtiny,SVG))
+ $(eval $(call pkg_config_find_and_add,ROSPRITE,librosprite,Sprite))
+ $(eval $(call pkg_config_find_and_add,BMP,libnsbmp,BMP))
+ $(eval $(call pkg_config_find_and_add,GIF,libnsgif,GIF))
+ $(eval $(call pkg_config_find_and_add,PNG,libpng,PNG ))
+
+ # no pkg-config for this library
+ $(eval $(call feature_enabled,WEBP,-DWITH_WEBP,-lwebp -lvpx,WebP (libwebp)))
+
+ GTKCFLAGS := -std=c99 -Dgtk -Dnsgtk \
+ -DGTK_DISABLE_DEPRECATED \
+ -D_BSD_SOURCE \
+ -D_XOPEN_SOURCE=600 \
+ -D_POSIX_C_SOURCE=200112L \
+ -D_NETBSD_SOURCE \
+ -DGTK_RESPATH=\"$(NETSURF_GTK_RESOURCES)\" \
+ $(WARNFLAGS) -I. -g \
+ $(shell $(PKG_CONFIG) --cflags libglade-2.0 gtk+-2.0) \
+ $(shell $(PKG_CONFIG) --cflags libhubbub libcurl) \
+ $(shell $(PKG_CONFIG) --cflags openssl) \
+ $(shell xml2-config --cflags)
+
+ GTKLDFLAGS := $(shell $(PKG_CONFIG) --cflags --libs libglade-2.0 gtk+-2.0 gthread-2.0 gmodule-2.0 lcms)
+
+ CFLAGS += $(GTKCFLAGS)
+ LDFLAGS += $(GTKLDFLAGS)
+
+ # ---------------------------------------------------------------------------
+ # Windows flag setup
+ # ---------------------------------------------------------------------------
+
+ ifeq ($(HOST),Windows_NT)
+ CFLAGS += -U__STRICT_ANSI__
+ endif
+
Added: trunk/netsurf/riscos/Makefile.target
URL: http://source.netsurf-browser.org/trunk/netsurf/riscos/Makefile.target?re...
==============================================================================
--- trunk/netsurf/riscos/Makefile.target (added)
+++ trunk/netsurf/riscos/Makefile.target Wed Oct 27 13:39:24 2010
@@ -1,0 +1,61 @@
+# RISC OS Target makefile
+
+# ----------------------------------------------------------------------------
+# RISC OS target setup
+# ----------------------------------------------------------------------------
+
+ ifeq ($(HOST),riscos)
+ LDFLAGS += -Xlinker -symbols=$(OBJROOT)/sym -lxml2 -lz -lm -lcurl -lcares
+ LDFLAGS += -lssl -lcrypto -lhubbub -lcss -lparserutils -lwapcaplet
+ else
+ LDFLAGS += $(shell $(PKG_CONFIG) --libs libxml-2.0 libcares libcurl openssl)
+ LDFLAGS += $(shell $(PKG_CONFIG) --libs libhubbub libcss)
+ endif
+
+ $(eval $(call feature_enabled,NSSVG,-DWITH_NS_SVG,-lsvgtiny,SVG (libsvgtiny)))
+ $(eval $(call feature_enabled,DRAW,-DWITH_DRAW,,Drawfile rendering))
+ $(eval $(call feature_enabled,SPRITE,-DWITH_SPRITE,,Sprite rendering))
+ $(eval $(call feature_enabled,ARTWORKS,-DWITH_ARTWORKS,,ArtWorks rendering))
+ $(eval $(call feature_enabled,PLUGINS,-DWITH_PLUGIN,,Plugin protocol))
+ $(eval $(call feature_enabled,DRAW_EXPORT,-DWITH_DRAW_EXPORT,-lpencil,Drawfile export))
+ ifeq ($(HOST),riscos)
+ $(eval $(call feature_enabled,BMP,-DWITH_BMP,-lnsbmp,BMP (libnsbmp)))
+ $(eval $(call feature_enabled,GIF,-DWITH_GIF,-lnsgif,GIF (libnsgif)))
+ $(eval $(call feature_enabled,PNG,-DWITH_PNG,-lpng,PNG (libpng) ))
+ else
+ NETSURF_FEATURE_BMP_CFLAGS := -DWITH_BMP
+ NETSURF_FEATURE_GIF_CFLAGS := -DWITH_GIF
+ NETSURF_FEATURE_PNG_CFLAGS := -DWITH_PNG
+ $(eval $(call pkg_config_find_and_add,BMP,libnsbmp,BMP))
+ $(eval $(call pkg_config_find_and_add,GIF,libnsgif,GIF))
+ $(eval $(call pkg_config_find_and_add,PNG,libpng,PNG ))
+ endif
+
+ TPD_RISCOS = $(foreach TPL,$(notdir $(TPL_RISCOS)), \
+ !NetSurf/Resources/$(TPL)/Templates$(TPLEXT))
+
+ RESOURCES = $(TPD_RISCOS)
+
+ CFLAGS += -I. $(WARNFLAGS) -Driscos \
+ -std=c99 -D_BSD_SOURCE -D_POSIX_C_SOURCE \
+ -mpoke-function-name -fno-strict-aliasing
+
+ CFLAGS += -I$(GCCSDK_INSTALL_ENV)/include \
+ -I$(GCCSDK_INSTALL_ENV)/include/libxml2 \
+ -I$(GCCSDK_INSTALL_ENV)/include/libmng
+ ifeq ($(HOST),riscos)
+ CFLAGS += -I<OSLib$$Dir> -mthrowback
+ endif
+ ASFLAGS += -xassembler-with-cpp -I. -I$(GCCSDK_INSTALL_ENV)/include
+ LDFLAGS += -L$(GCCSDK_INSTALL_ENV)/lib -lrufl
+ ifeq ($(HOST),riscos)
+ LDFLAGS += -LOSLib: -lOSLib32
+ else
+ LDFLAGS += -lOSLib32
+ ifeq ($(SUBTARGET),-elf)
+ # Go for static builds & AIF binary at the moment:
+ CFLAGS += -static
+ LDFLAGS += -static
+ EXEEXT := ,ff8
+ endif
+ endif
Added: trunk/netsurf/windows/Makefile.target
URL: http://source.netsurf-browser.org/trunk/netsurf/windows/Makefile.target?r...
==============================================================================
--- trunk/netsurf/windows/Makefile.target (added)
+++ trunk/netsurf/windows/Makefile.target Wed Oct 27 13:39:24 2010
@@ -1,0 +1,30 @@
+# ----------------------------------------------------------------------------
+# Windows target setup
+# ----------------------------------------------------------------------------
+
+ NETSURF_FEATURE_NSSVG_CFLAGS := -DWITH_NS_SVG
+ NETSURF_FEATURE_ROSPRITE_CFLAGS := -DWITH_NSSPRITE
+ NETSURF_FEATURE_BMP_CFLAGS := -DWITH_BMP
+ NETSURF_FEATURE_GIF_CFLAGS := -DWITH_GIF
+ NETSURF_FEATURE_PNG_CFLAGS := -DWITH_PNG
+ $(eval $(call feature_enabled,BMP,-DWITH_BMP,-lnsbmp,BMP (libnsbmp)))
+ $(eval $(call feature_enabled,GIF,-DWITH_GIF,-lnsgif,GIF (libnsgif)))
+ $(eval $(call feature_enabled,PNG,-DWITH_PNG,-lpng,PNG (libpng) ))
+ $(eval $(call feature_enabled,NSSVG,-DWITH_NS_SVG,-lsvgtiny,SVG (libsvgtiny)))
+ $(eval $(call feature_enabled,MNG,,-llcms -ljpeg,PNG/JNG/MNG (libmng)))
+
+ LDFLAGS += -L${MINGW_INSTALL_ENV}/lib $(shell $(PKG_CONFIG) --libs zlib \
+ libxml-2.0 libcurl libhubbub libparserutils libcss libwapcaplet) \
+ -lparserutils -lssl -lcrypto -lregex -liconv -lcss -lwapcaplet \
+ -lgdi32 -lcomctl32 -lws2_32 -lmsimg32 -mwindows
+ CFLAGS += -U__STRICT_ANSI__ -mwin32
+ # only windows versions after 2000 are supported
+ CFLAGS += '-DWINVER=0x0500'
+ WSCFLAGS := -std=c99 \
+ $(WARNFLAGS) -I. -I/${MINGW_INSTALL_ENV}/include \
+ -DCURL_STATICLIB \
+ $(shell $(PKG_CONFIG) --cflags libcurl libhubbub zlib libparserutils \
+ libxml-2.0) -g
+ CFLAGS += $(WSCFLAGS)
+ LDFLAGS += $(WSCFLAGS)
+
12Â years, 7Â months
r10909 chris_y - /trunk/netsurf/amiga/tree.c
by netsurfï¼ semichrome.net
Author: chris_y
Date: Mon Oct 25 12:26:34 2010
New Revision: 10909
URL: http://source.netsurf-browser.org?rev=10909&view=rev
Log:
Don't feed negative values to the scroller
Modified:
trunk/netsurf/amiga/tree.c
Modified: trunk/netsurf/amiga/tree.c
URL: http://source.netsurf-browser.org/trunk/netsurf/amiga/tree.c?rev=10909&r1...
==============================================================================
--- trunk/netsurf/amiga/tree.c (original)
+++ trunk/netsurf/amiga/tree.c Mon Oct 25 12:26:34 2010
@@ -248,12 +248,18 @@
GetAttr(SCROLLER_Top, twin->objects[OID_HSCROLL], (ULONG *)&x);
GetAttr(SCROLLER_Top, twin->objects[OID_VSCROLL], (ULONG *)&y);
+ x += sx;
+ y += sy;
+
+ if(y < 0) y = 0;
+ if(x < 0) x = 0;
+
RefreshSetGadgetAttrs((APTR)twin->objects[OID_VSCROLL], twin->win, NULL,
- SCROLLER_Top, y + sy,
+ SCROLLER_Top, y,
TAG_DONE);
RefreshSetGadgetAttrs((APTR)twin->objects[OID_HSCROLL], twin->win, NULL,
- SCROLLER_Top, x + sx,
+ SCROLLER_Top, x,
TAG_DONE);
ami_tree_draw(twin);
12Â years, 7Â months
r10908 stevef - in /trunk/netsurf/riscos: cookies.c cookies.h global_history.c global_history.h gui.c hotlist.c hotlist.h menus.c menus.h theme.c wimp_event.c window.c
by netsurfï¼ semichrome.net
Author: stevef
Date: Sun Oct 24 18:17:21 2010
New Revision: 10908
URL: http://source.netsurf-browser.org?rev=10908&view=rev
Log:
Restore toolbar menus in RO treeview windows.
Modified:
trunk/netsurf/riscos/cookies.c
trunk/netsurf/riscos/cookies.h
trunk/netsurf/riscos/global_history.c
trunk/netsurf/riscos/global_history.h
trunk/netsurf/riscos/gui.c
trunk/netsurf/riscos/hotlist.c
trunk/netsurf/riscos/hotlist.h
trunk/netsurf/riscos/menus.c
trunk/netsurf/riscos/menus.h
trunk/netsurf/riscos/theme.c
trunk/netsurf/riscos/wimp_event.c
trunk/netsurf/riscos/window.c
Modified: trunk/netsurf/riscos/cookies.c
URL: http://source.netsurf-browser.org/trunk/netsurf/riscos/cookies.c?rev=1090...
==============================================================================
--- trunk/netsurf/riscos/cookies.c (original)
+++ trunk/netsurf/riscos/cookies.c Sun Oct 24 18:17:21 2010
@@ -45,12 +45,6 @@
#include "utils/url.h"
#include "utils/utils.h"
-static void ro_gui_cookies_menu_prepare(wimp_w window, wimp_menu *menu);
-static bool ro_gui_cookies_menu_select(wimp_w window, wimp_menu *menu,
- wimp_selection *selection, menu_action action);
-static void ro_gui_cookies_menu_warning(wimp_w window, wimp_menu *menu,
- wimp_selection *selection, menu_action action);
-
/* The RISC OS cookie window, toolbar and treeview data. */
static struct ro_cookies_window {
@@ -160,6 +154,9 @@
bool ro_gui_cookies_toolbar_click(wimp_pointer *pointer)
{
+ if (pointer->buttons == wimp_CLICK_MENU)
+ return ro_gui_wimp_event_process_window_menu_click(pointer);
+
if (cookies_window.toolbar->editor != NULL) {
ro_gui_theme_toolbar_editor_click(cookies_window.toolbar,
pointer);
@@ -193,13 +190,6 @@
break;
}
- /* \todo -- We assume that the owning module will have attached a window menu
- * to our parent window. If it hasn't, this call will quietly fail.
- */
-
- if (pointer->buttons == wimp_CLICK_MENU)
- return ro_gui_wimp_event_process_window_menu_click(pointer);
-
return false;
}
@@ -214,24 +204,29 @@
{
bool selection;
- selection = ro_treeview_has_selection(cookies_window.tv);
-
- ro_gui_menu_set_entry_shaded(cookies_window.menu, TREE_SELECTION,
- !selection);
- ro_gui_menu_set_entry_shaded(cookies_window.menu, TREE_CLEAR_SELECTION,
- !selection);
-
- ro_gui_menu_set_entry_shaded(cookies_window.menu, TOOLBAR_BUTTONS,
+ if (menu != cookies_window.menu && menu != tree_toolbar_menu)
+ return;
+
+ if (menu == cookies_window.menu) {
+ selection = ro_treeview_has_selection(cookies_window.tv);
+
+ ro_gui_menu_set_entry_shaded(cookies_window.menu, TREE_SELECTION,
+ !selection);
+ ro_gui_menu_set_entry_shaded(cookies_window.menu, TREE_CLEAR_SELECTION,
+ !selection);
+ }
+
+ ro_gui_menu_set_entry_shaded(menu, TOOLBAR_BUTTONS,
(cookies_window.toolbar == NULL ||
cookies_window.toolbar->editor));
- ro_gui_menu_set_entry_ticked(cookies_window.menu, TOOLBAR_BUTTONS,
+ ro_gui_menu_set_entry_ticked(menu, TOOLBAR_BUTTONS,
(cookies_window.toolbar != NULL &&
(cookies_window.toolbar->display_buttons ||
(cookies_window.toolbar->editor))));
- ro_gui_menu_set_entry_shaded(cookies_window.menu, TOOLBAR_EDIT,
+ ro_gui_menu_set_entry_shaded(menu, TOOLBAR_EDIT,
cookies_window.toolbar == NULL);
- ro_gui_menu_set_entry_ticked(cookies_window.menu, TOOLBAR_EDIT,
+ ro_gui_menu_set_entry_ticked(menu, TOOLBAR_EDIT,
(cookies_window.toolbar != NULL &&
cookies_window.toolbar->editor));
}
Modified: trunk/netsurf/riscos/cookies.h
URL: http://source.netsurf-browser.org/trunk/netsurf/riscos/cookies.h?rev=1090...
==============================================================================
--- trunk/netsurf/riscos/cookies.h (original)
+++ trunk/netsurf/riscos/cookies.h Sun Oct 24 18:17:21 2010
@@ -24,12 +24,20 @@
#ifndef _NETSURF_RISCOS_COOKIES_H_
#define _NETSURF_RISCOS_COOKIES_H_
+#include "riscos/menus.h"
+
void ro_gui_cookies_preinitialise(void);
void ro_gui_cookies_postinitialise(void);
bool ro_gui_cookies_check_window(wimp_w window);
bool ro_gui_cookies_check_menu(wimp_menu *menu);
bool ro_gui_cookies_toolbar_click(wimp_pointer *pointer);
+void ro_gui_cookies_menu_prepare(wimp_w window, wimp_menu *menu);
+bool ro_gui_cookies_menu_select(wimp_w window, wimp_menu *menu,
+ wimp_selection *selection, menu_action action);
+void ro_gui_cookies_menu_warning(wimp_w window, wimp_menu *menu,
+ wimp_selection *selection, menu_action action);
+
void ro_gui_cookies_open(void);
void ro_gui_cookies_update_theme(bool full_update);
Modified: trunk/netsurf/riscos/global_history.c
URL: http://source.netsurf-browser.org/trunk/netsurf/riscos/global_history.c?r...
==============================================================================
--- trunk/netsurf/riscos/global_history.c (original)
+++ trunk/netsurf/riscos/global_history.c Sun Oct 24 18:17:21 2010
@@ -47,12 +47,6 @@
#include "utils/url.h"
#include "utils/utils.h"
-static void ro_gui_global_history_menu_prepare(wimp_w window, wimp_menu *menu);
-static bool ro_gui_global_history_menu_select(wimp_w window, wimp_menu *menu,
- wimp_selection *selection, menu_action action);
-static void ro_gui_global_history_menu_warning(wimp_w window, wimp_menu *menu,
- wimp_selection *selection, menu_action action);
-
/* The RISC OS global history window, toolbar and treeview data */
static struct ro_global_history_window {
@@ -167,6 +161,9 @@
bool ro_gui_global_history_toolbar_click(wimp_pointer *pointer)
{
+ if (pointer->buttons == wimp_CLICK_MENU)
+ return ro_gui_wimp_event_process_window_menu_click(pointer);
+
if (global_history_window.toolbar->editor != NULL) {
ro_gui_theme_toolbar_editor_click(global_history_window.toolbar,
pointer);
@@ -206,13 +203,6 @@
break;
}
- /* \todo -- We assume that the owning module will have attached a window menu
- * to our parent window. If it hasn't, this call will quietly fail.
- */
-
- if (pointer->buttons == wimp_CLICK_MENU)
- return ro_gui_wimp_event_process_window_menu_click(pointer);
-
return true;
}
@@ -228,31 +218,34 @@
{
bool selection;
- selection = ro_treeview_has_selection(global_history_window.tv);
-
- ro_gui_menu_set_entry_shaded(global_history_window.menu,
- TREE_SELECTION, !selection);
- ro_gui_menu_set_entry_shaded(global_history_window.menu,
- TREE_CLEAR_SELECTION, !selection);
-
- ro_gui_menu_set_entry_shaded(global_history_window.menu,
- TOOLBAR_BUTTONS,
+ if (menu != global_history_window.menu && menu != tree_toolbar_menu)
+ return;
+
+ if (menu == global_history_window.menu) {
+ selection = ro_treeview_has_selection(global_history_window.tv);
+
+ ro_gui_menu_set_entry_shaded(global_history_window.menu,
+ TREE_SELECTION, !selection);
+ ro_gui_menu_set_entry_shaded(global_history_window.menu,
+ TREE_CLEAR_SELECTION, !selection);
+
+ ro_gui_save_prepare(GUI_SAVE_HISTORY_EXPORT_HTML,
+ NULL, NULL, NULL, NULL);
+ }
+
+ ro_gui_menu_set_entry_shaded(menu, TOOLBAR_BUTTONS,
(global_history_window.toolbar == NULL ||
global_history_window.toolbar->editor));
- ro_gui_menu_set_entry_ticked(global_history_window.menu,
- TOOLBAR_BUTTONS,
+ ro_gui_menu_set_entry_ticked(menu, TOOLBAR_BUTTONS,
(global_history_window.toolbar != NULL &&
(global_history_window.toolbar->display_buttons ||
(global_history_window.toolbar->editor))));
- ro_gui_menu_set_entry_shaded(global_history_window.menu, TOOLBAR_EDIT,
+ ro_gui_menu_set_entry_shaded(menu, TOOLBAR_EDIT,
global_history_window.toolbar == NULL);
- ro_gui_menu_set_entry_ticked(global_history_window.menu, TOOLBAR_EDIT,
+ ro_gui_menu_set_entry_ticked(menu, TOOLBAR_EDIT,
(global_history_window.toolbar != NULL &&
global_history_window.toolbar->editor));
-
- ro_gui_save_prepare(GUI_SAVE_HISTORY_EXPORT_HTML,
- NULL, NULL, NULL, NULL);
}
/**
Modified: trunk/netsurf/riscos/global_history.h
URL: http://source.netsurf-browser.org/trunk/netsurf/riscos/global_history.h?r...
==============================================================================
--- trunk/netsurf/riscos/global_history.h (original)
+++ trunk/netsurf/riscos/global_history.h Sun Oct 24 18:17:21 2010
@@ -24,6 +24,8 @@
#ifndef _NETSURF_RISCOS_GLOBALHISTORY_H_
#define _NETSURF_RISCOS_GLOBALHISTORY_H_
+#include "riscos/menus.h"
+
void ro_gui_global_history_preinitialise(void);
void ro_gui_global_history_postinitialise(void);
void ro_gui_global_history_open(void);
@@ -33,5 +35,11 @@
bool ro_gui_global_history_check_menu(wimp_menu *menu);
bool ro_gui_global_history_toolbar_click(wimp_pointer *pointer);
+void ro_gui_global_history_menu_prepare(wimp_w window, wimp_menu *menu);
+bool ro_gui_global_history_menu_select(wimp_w window, wimp_menu *menu,
+ wimp_selection *selection, menu_action action);
+void ro_gui_global_history_menu_warning(wimp_w window, wimp_menu *menu,
+ wimp_selection *selection, menu_action action);
+
#endif
Modified: trunk/netsurf/riscos/gui.c
URL: http://source.netsurf-browser.org/trunk/netsurf/riscos/gui.c?rev=10908&r1...
==============================================================================
--- trunk/netsurf/riscos/gui.c (original)
+++ trunk/netsurf/riscos/gui.c Sun Oct 24 18:17:21 2010
@@ -987,9 +987,9 @@
gui_last_poll = clock();
ro_gui_handle_event(event, &block);
- /* Only run scheduled callbacks on a null poll
- * We cannot do this in the null event handler, as that may be called
- * from gui_multitask(). Scheduled callbacks must only be run from the
+ /* Only run scheduled callbacks on a null poll
+ * We cannot do this in the null event handler, as that may be called
+ * from gui_multitask(). Scheduled callbacks must only be run from the
* top-level.
*/
if (event == wimp_NULL_REASON_CODE)
@@ -1248,7 +1248,8 @@
if (pointer->buttons == wimp_CLICK_MENU) {
ro_gui_menu_create(iconbar_menu, pointer->pos.x,
- 96 + iconbar_menu_height, wimp_ICON_BAR);
+ 96 + iconbar_menu_height, wimp_ICON_BAR,
+ true);
} else if (pointer->buttons == wimp_CLICK_SELECT) {
if (option_homepage_url && option_homepage_url[0]) {
@@ -2070,7 +2071,7 @@
/* create a unix path from teh cananocal risc os one */
unix_path = __unixify(canonical_path, __RISCOSIFY_NO_REVERSE_SUFFIX, NULL, 0, 0);
-
+
if (unix_path == NULL) {
LOG(("__unixify failed: %s", canonical_path));
free(canonical_path);
@@ -2092,7 +2093,7 @@
} else {
snprintf(url, urllen, "%s%s", FILE_SCHEME_PREFIX, unix_path);
}
- free(unix_path);
+ free(unix_path);
/* We don't want '/' to be escaped. */
url_err = url_escape(url, FILE_SCHEME_PREFIX_LEN, false, "/", &escurl);
Modified: trunk/netsurf/riscos/hotlist.c
URL: http://source.netsurf-browser.org/trunk/netsurf/riscos/hotlist.c?rev=1090...
==============================================================================
--- trunk/netsurf/riscos/hotlist.c (original)
+++ trunk/netsurf/riscos/hotlist.c Sun Oct 24 18:17:21 2010
@@ -48,12 +48,6 @@
#include "utils/utils.h"
#include "utils/url.h"
-static void ro_gui_hotlist_menu_prepare(wimp_w window, wimp_menu *menu);
-static bool ro_gui_hotlist_menu_select(wimp_w window, wimp_menu *menu,
- wimp_selection *selection, menu_action action);
-static void ro_gui_hotlist_menu_warning(wimp_w window, wimp_menu *menu,
- wimp_selection *selection, menu_action action);
-
/* The RISC OS hotlist window, toolbar and treeview data. */
static struct ro_hotlist {
@@ -181,6 +175,9 @@
bool ro_gui_hotlist_toolbar_click(wimp_pointer *pointer)
{
+ if (pointer->buttons == wimp_CLICK_MENU)
+ return ro_gui_wimp_event_process_window_menu_click(pointer);
+
if (hotlist_window.toolbar->editor != NULL) {
ro_gui_theme_toolbar_editor_click(hotlist_window.toolbar,
pointer);
@@ -226,14 +223,6 @@
break;
}
-
- /* \todo -- We assume that the owning module will have attached a window menu
- * to our parent window. If it hasn't, this call will quietly fail.
- */
-
- if (pointer->buttons == wimp_CLICK_MENU)
- return ro_gui_wimp_event_process_window_menu_click(pointer);
-
return true;
}
@@ -249,30 +238,36 @@
{
bool selection;
- selection = ro_treeview_has_selection(hotlist_window.tv);
-
- ro_gui_menu_set_entry_shaded(hotlist_window.menu, TREE_SELECTION,
- !selection);
- ro_gui_menu_set_entry_shaded(hotlist_window.menu, TREE_CLEAR_SELECTION,
- !selection);
-
- ro_gui_menu_set_entry_shaded(hotlist_window.menu, TOOLBAR_BUTTONS,
+ if (menu != hotlist_window.menu && menu != tree_toolbar_menu)
+ return;
+
+ if (menu == hotlist_window.menu) {
+ selection = ro_treeview_has_selection(hotlist_window.tv);
+
+ ro_gui_menu_set_entry_shaded(hotlist_window.menu,
+ TREE_SELECTION, !selection);
+ ro_gui_menu_set_entry_shaded(hotlist_window.menu,
+ TREE_CLEAR_SELECTION, !selection);
+
+ ro_gui_save_prepare(GUI_SAVE_HOTLIST_EXPORT_HTML,
+ NULL, NULL, NULL, NULL);
+ }
+
+ ro_gui_menu_set_entry_shaded(menu, TOOLBAR_BUTTONS,
(hotlist_window.toolbar == NULL ||
hotlist_window.toolbar->editor != NULL));
- ro_gui_menu_set_entry_ticked(hotlist_window.menu, TOOLBAR_BUTTONS,
+ ro_gui_menu_set_entry_ticked(menu, TOOLBAR_BUTTONS,
(hotlist_window.toolbar != NULL &&
(hotlist_window.toolbar->display_buttons ||
(hotlist_window.toolbar->editor != NULL))));
- ro_gui_menu_set_entry_shaded(hotlist_window.menu, TOOLBAR_EDIT,
+ ro_gui_menu_set_entry_shaded(menu, TOOLBAR_EDIT,
hotlist_window.toolbar == NULL);
- ro_gui_menu_set_entry_ticked(hotlist_window.menu, TOOLBAR_EDIT,
+ ro_gui_menu_set_entry_ticked(menu, TOOLBAR_EDIT,
(hotlist_window.toolbar != NULL &&
hotlist_window.toolbar->editor != NULL));
-
- ro_gui_save_prepare(GUI_SAVE_HOTLIST_EXPORT_HTML,
- NULL, NULL, NULL, NULL);
-}
+}
+
/**
* Handle submenu warnings for the hotlist menu
Modified: trunk/netsurf/riscos/hotlist.h
URL: http://source.netsurf-browser.org/trunk/netsurf/riscos/hotlist.h?rev=1090...
==============================================================================
--- trunk/netsurf/riscos/hotlist.h (original)
+++ trunk/netsurf/riscos/hotlist.h Sun Oct 24 18:17:21 2010
@@ -24,6 +24,8 @@
#ifndef _NETSURF_RISCOS_HOTLIST_H_
#define _NETSURF_RISCOS_HOTLIST_H_
+#include "riscos/menus.h"
+
void ro_gui_hotlist_preinitialise(void);
void ro_gui_hotlist_postinitialise(void);
void ro_gui_hotlist_open(void);
@@ -32,6 +34,11 @@
bool ro_gui_hotlist_check_window(wimp_w window);
bool ro_gui_hotlist_check_menu(wimp_menu *menu);
bool ro_gui_hotlist_toolbar_click(wimp_pointer *pointer);
+void ro_gui_hotlist_menu_prepare(wimp_w window, wimp_menu *menu);
+bool ro_gui_hotlist_menu_select(wimp_w window, wimp_menu *menu,
+ wimp_selection *selection, menu_action action);
+void ro_gui_hotlist_menu_warning(wimp_w window, wimp_menu *menu,
+ wimp_selection *selection, menu_action action);
#endif
Modified: trunk/netsurf/riscos/menus.c
URL: http://source.netsurf-browser.org/trunk/netsurf/riscos/menus.c?rev=10908&...
==============================================================================
--- trunk/netsurf/riscos/menus.c (original)
+++ trunk/netsurf/riscos/menus.c Sun Oct 24 18:17:21 2010
@@ -301,6 +301,7 @@
};
tree_toolbar_menu = ro_gui_menu_define_menu(&tree_toolbar_definition);
+
/* proxy menu */
static const struct ns_menu proxy_type_definition = {
"ProxyType", {
@@ -375,8 +376,15 @@
/**
* Display a menu.
- */
-void ro_gui_menu_create(wimp_menu *menu, int x, int y, wimp_w w)
+ *
+ * \param *menu Pointer to the menu to be displayed.
+ * \param x The x position.
+ * \param y The y position.
+ * \param w The window that the menu belongs to.
+ * \param prepare true if the menu is to be prepared; otherwise
+ * false (mainly for use by wimp_event module).
+ */
+void ro_gui_menu_create(wimp_menu *menu, int x, int y, wimp_w w, bool prepare)
{
struct gui_window *g;
os_error *error;
@@ -442,7 +450,7 @@
} else if (menu == recent_search_menu) {
if (!ro_gui_search_prepare_menu())
return;
- } else {
+ } else if (prepare) {
i = 0;
do {
action = ro_gui_menu_find_action(menu,
@@ -499,7 +507,7 @@
ro_gui_menu_create(menu,
state.visible.x0 + icon_state.icon.extent.x1 + 64,
state.visible.y1 + icon_state.icon.extent.y1 -
- state.yscroll, w);
+ state.yscroll, w, true);
current_menu_icon = i;
}
@@ -679,7 +687,7 @@
assert(g); /* Keep scan-build happy */
gui_create_form_select_menu(g->bw, gui_form_select_control);
} else
- ro_gui_menu_create(current_menu, 0, 0, current_menu_window);
+ ro_gui_menu_create(current_menu, 0, 0, current_menu_window, true);
current_menu_icon = previous_menu_icon;
}
@@ -989,7 +997,7 @@
gui_form_select_control = control;
ro_gui_menu_create(gui_form_select_menu,
- pointer.pos.x, pointer.pos.y, bw->window->window);
+ pointer.pos.x, pointer.pos.y, bw->window->window, true);
}
Modified: trunk/netsurf/riscos/menus.h
URL: http://source.netsurf-browser.org/trunk/netsurf/riscos/menus.h?rev=10908&...
==============================================================================
--- trunk/netsurf/riscos/menus.h (original)
+++ trunk/netsurf/riscos/menus.h Sun Oct 24 18:17:21 2010
@@ -170,7 +170,7 @@
void ro_gui_menu_init(void);
-void ro_gui_menu_create(wimp_menu* menu, int x, int y, wimp_w w);
+void ro_gui_menu_create(wimp_menu* menu, int x, int y, wimp_w w, bool prepare);
bool ro_gui_menu_handle_action(wimp_w owner, menu_action action,
bool windows_at_pointer);
void ro_gui_menu_prepare_action(wimp_w owner, menu_action action,
Modified: trunk/netsurf/riscos/theme.c
URL: http://source.netsurf-browser.org/trunk/netsurf/riscos/theme.c?rev=10908&...
==============================================================================
--- trunk/netsurf/riscos/theme.c (original)
+++ trunk/netsurf/riscos/theme.c Sun Oct 24 18:17:21 2010
@@ -951,16 +951,31 @@
case THEME_HOTLIST_EDIT_TOOLBAR:
ro_gui_wimp_event_register_mouse_click(toolbar->toolbar_handle,
ro_gui_hotlist_toolbar_click);
+ ro_gui_wimp_event_register_window_menu(toolbar->toolbar_handle,
+ tree_toolbar_menu,
+ ro_gui_hotlist_menu_prepare,
+ ro_gui_hotlist_menu_select, NULL,
+ ro_gui_hotlist_menu_warning, false);
break;
case THEME_HISTORY_TOOLBAR:
case THEME_HISTORY_EDIT_TOOLBAR:
ro_gui_wimp_event_register_mouse_click(toolbar->toolbar_handle,
ro_gui_global_history_toolbar_click);
+ ro_gui_wimp_event_register_window_menu(toolbar->toolbar_handle,
+ tree_toolbar_menu,
+ ro_gui_global_history_menu_prepare,
+ ro_gui_global_history_menu_select, NULL,
+ ro_gui_global_history_menu_warning, false);
break;
case THEME_COOKIES_TOOLBAR:
case THEME_COOKIES_EDIT_TOOLBAR:
ro_gui_wimp_event_register_mouse_click(toolbar->toolbar_handle,
ro_gui_cookies_toolbar_click);
+ ro_gui_wimp_event_register_window_menu(toolbar->toolbar_handle,
+ tree_toolbar_menu,
+ ro_gui_cookies_menu_prepare,
+ ro_gui_cookies_menu_select, NULL,
+ ro_gui_cookies_menu_warning, false);
break;
default:
break;
Modified: trunk/netsurf/riscos/wimp_event.c
URL: http://source.netsurf-browser.org/trunk/netsurf/riscos/wimp_event.c?rev=1...
==============================================================================
--- trunk/netsurf/riscos/wimp_event.c (original)
+++ trunk/netsurf/riscos/wimp_event.c Sun Oct 24 18:17:21 2010
@@ -985,7 +985,8 @@
window->window_menu);
ro_gui_menu_create(window->window_menu,
- pointer->pos.x, pointer->pos.y, window->w);
+ pointer->pos.x, pointer->pos.y,
+ window->w, false);
return true;
}
return false;
Modified: trunk/netsurf/riscos/window.c
URL: http://source.netsurf-browser.org/trunk/netsurf/riscos/window.c?rev=10908...
==============================================================================
--- trunk/netsurf/riscos/window.c (original)
+++ trunk/netsurf/riscos/window.c Sun Oct 24 18:17:21 2010
@@ -593,7 +593,7 @@
y0 = -ceilf((data->redraw.y + data->redraw.height) * 2 * g->bw->scale);
x1 = ceilf((data->redraw.x + data->redraw.width) * 2 * g->bw->scale) + 1;
y1 = -floorf(data->redraw.y * 2 * g->bw->scale) + 1;
- use_buffer =
+ use_buffer =
(g->option.buffer_everything || g->option.buffer_animations);
/* try to optimise buffered redraws */
@@ -1398,7 +1398,7 @@
* \param g gui_window containing the content
* \param c the content to save
*/
-void gui_window_save_link(struct gui_window *g, const char *url,
+void gui_window_save_link(struct gui_window *g, const char *url,
const char *title)
{
ro_gui_save_prepare(GUI_SAVE_LINK_URL, NULL, NULL, url, title);
@@ -2148,7 +2148,7 @@
/* Handle Menu clicks */
if (pointer->buttons == wimp_CLICK_MENU) {
ro_gui_menu_create(browser_toolbar_menu, pointer->pos.x,
- pointer->pos.y, g->window);
+ pointer->pos.y, g->window, true);
return true;
}
@@ -2317,7 +2317,7 @@
gui_window_place_caret(g, -100, -100, 0);
if (pointer->buttons == wimp_CLICK_MENU) {
- ro_gui_menu_create(browser_menu, pointer->pos.x, pointer->pos.y, pointer->w);
+ ro_gui_menu_create(browser_menu, pointer->pos.x, pointer->pos.y, pointer->w, true);
} else {
if (ro_gui_window_to_window_pos(g, pointer->pos.x, pointer->pos.y, &pos))
browser_window_mouse_click(g->bw,
12Â years, 7Â months
r10907 stevef - in /trunk/netsurf/riscos: cookies.c cookies.h global_history.c global_history.h hotlist.c hotlist.h menus.c theme.c theme.h treeview.c treeview.h
by netsurfï¼ semichrome.net
Author: stevef
Date: Sun Oct 24 16:52:16 2010
New Revision: 10907
URL: http://source.netsurf-browser.org?rev=10907&view=rev
Log:
Re-enable toolbar editing and button selection in RO treeview windows.
Modified:
trunk/netsurf/riscos/cookies.c
trunk/netsurf/riscos/cookies.h
trunk/netsurf/riscos/global_history.c
trunk/netsurf/riscos/global_history.h
trunk/netsurf/riscos/hotlist.c
trunk/netsurf/riscos/hotlist.h
trunk/netsurf/riscos/menus.c
trunk/netsurf/riscos/theme.c
trunk/netsurf/riscos/theme.h
trunk/netsurf/riscos/treeview.c
trunk/netsurf/riscos/treeview.h
Modified: trunk/netsurf/riscos/cookies.c
URL: http://source.netsurf-browser.org/trunk/netsurf/riscos/cookies.c?rev=1090...
==============================================================================
--- trunk/netsurf/riscos/cookies.c (original)
+++ trunk/netsurf/riscos/cookies.c Sun Oct 24 16:52:16 2010
@@ -160,6 +160,12 @@
bool ro_gui_cookies_toolbar_click(wimp_pointer *pointer)
{
+ if (cookies_window.toolbar->editor != NULL) {
+ ro_gui_theme_toolbar_editor_click(cookies_window.toolbar,
+ pointer);
+ return true;
+ }
+
switch (pointer->i) {
case ICON_TOOLBAR_DELETE:
if (pointer->buttons == wimp_CLICK_SELECT) {
@@ -286,6 +292,14 @@
case TREE_CLEAR_SELECTION:
cookies_clear_selection();
return true;
+ case TOOLBAR_BUTTONS:
+ cookies_window.toolbar->display_buttons =
+ !cookies_window.toolbar->display_buttons;
+ ro_gui_theme_refresh_toolbar(cookies_window.toolbar);
+ return true;
+ case TOOLBAR_EDIT:
+ ro_gui_theme_toggle_edit(cookies_window.toolbar);
+ return true;
default:
return false;
}
@@ -295,11 +309,17 @@
/**
* Update the theme details of the cookies window.
- */
-
-void ro_gui_cookies_update_theme(void)
-{
- ro_treeview_update_theme(cookies_window.tv);
+ *
+ * \param full_update true to force a full theme change; false to
+ * refresh the toolbar size.
+ */
+
+void ro_gui_cookies_update_theme(bool full_update)
+{
+ if (full_update)
+ ro_treeview_update_theme(cookies_window.tv);
+ else
+ ro_treeview_update_toolbar(cookies_window.tv);
}
/**
@@ -311,9 +331,9 @@
bool ro_gui_cookies_check_window(wimp_w window)
{
-/* SF if (cookies_window.w == window)
- return true;
- else*/
+ if (cookies_window.window == window)
+ return true;
+ else
return false;
}
Modified: trunk/netsurf/riscos/cookies.h
URL: http://source.netsurf-browser.org/trunk/netsurf/riscos/cookies.h?rev=1090...
==============================================================================
--- trunk/netsurf/riscos/cookies.h (original)
+++ trunk/netsurf/riscos/cookies.h Sun Oct 24 16:52:16 2010
@@ -31,7 +31,7 @@
bool ro_gui_cookies_toolbar_click(wimp_pointer *pointer);
void ro_gui_cookies_open(void);
-void ro_gui_cookies_update_theme(void);
+void ro_gui_cookies_update_theme(bool full_update);
#endif
Modified: trunk/netsurf/riscos/global_history.c
URL: http://source.netsurf-browser.org/trunk/netsurf/riscos/global_history.c?r...
==============================================================================
--- trunk/netsurf/riscos/global_history.c (original)
+++ trunk/netsurf/riscos/global_history.c Sun Oct 24 16:52:16 2010
@@ -167,6 +167,12 @@
bool ro_gui_global_history_toolbar_click(wimp_pointer *pointer)
{
+ if (global_history_window.toolbar->editor != NULL) {
+ ro_gui_theme_toolbar_editor_click(global_history_window.toolbar,
+ pointer);
+ return true;
+ }
+
switch (pointer->i) {
case ICON_TOOLBAR_DELETE:
if (pointer->buttons == wimp_CLICK_SELECT) {
@@ -311,6 +317,14 @@
case TREE_CLEAR_SELECTION:
history_global_clear_selection();
return true;
+ case TOOLBAR_BUTTONS:
+ global_history_window.toolbar->display_buttons =
+ !global_history_window.toolbar->display_buttons;
+ ro_gui_theme_refresh_toolbar(global_history_window.toolbar);
+ return true;
+ case TOOLBAR_EDIT:
+ ro_gui_theme_toggle_edit(global_history_window.toolbar);
+ return true;
default:
return false;
}
@@ -320,11 +334,17 @@
/**
* Update the theme details of the global history window.
- */
-
-void ro_gui_global_history_update_theme(void)
-{
- ro_treeview_update_theme(global_history_window.tv);
+ *
+ * \param full_update true to force a full theme change; false to
+ * refresh the toolbar size.
+ */
+
+void ro_gui_global_history_update_theme(bool full_update)
+{
+ if (full_update)
+ ro_treeview_update_theme(global_history_window.tv);
+ else
+ ro_treeview_update_toolbar(global_history_window.tv);
}
/**
@@ -336,9 +356,9 @@
bool ro_gui_global_history_check_window(wimp_w window)
{
-/* if (global_history_window.w == window)
- return true;
- else*/
+ if (global_history_window.window == window)
+ return true;
+ else
return false;
}
Modified: trunk/netsurf/riscos/global_history.h
URL: http://source.netsurf-browser.org/trunk/netsurf/riscos/global_history.h?r...
==============================================================================
--- trunk/netsurf/riscos/global_history.h (original)
+++ trunk/netsurf/riscos/global_history.h Sun Oct 24 16:52:16 2010
@@ -28,7 +28,7 @@
void ro_gui_global_history_postinitialise(void);
void ro_gui_global_history_open(void);
void ro_gui_global_history_save(void);
-void ro_gui_global_history_update_theme(void);
+void ro_gui_global_history_update_theme(bool full_update);
bool ro_gui_global_history_check_window(wimp_w window);
bool ro_gui_global_history_check_menu(wimp_menu *menu);
bool ro_gui_global_history_toolbar_click(wimp_pointer *pointer);
Modified: trunk/netsurf/riscos/hotlist.c
URL: http://source.netsurf-browser.org/trunk/netsurf/riscos/hotlist.c?rev=1090...
==============================================================================
--- trunk/netsurf/riscos/hotlist.c (original)
+++ trunk/netsurf/riscos/hotlist.c Sun Oct 24 16:52:16 2010
@@ -181,7 +181,11 @@
bool ro_gui_hotlist_toolbar_click(wimp_pointer *pointer)
{
- LOG(("Entering hotlist toolbar handler: b=%d, i=%d", pointer->buttons, pointer->i));
+ if (hotlist_window.toolbar->editor != NULL) {
+ ro_gui_theme_toolbar_editor_click(hotlist_window.toolbar,
+ pointer);
+ return true;
+ }
switch (pointer->i) {
case ICON_TOOLBAR_DELETE:
@@ -254,17 +258,17 @@
ro_gui_menu_set_entry_shaded(hotlist_window.menu, TOOLBAR_BUTTONS,
(hotlist_window.toolbar == NULL ||
- hotlist_window.toolbar->editor));
+ hotlist_window.toolbar->editor != NULL));
ro_gui_menu_set_entry_ticked(hotlist_window.menu, TOOLBAR_BUTTONS,
(hotlist_window.toolbar != NULL &&
(hotlist_window.toolbar->display_buttons ||
- hotlist_window.toolbar->editor)));
+ (hotlist_window.toolbar->editor != NULL))));
ro_gui_menu_set_entry_shaded(hotlist_window.menu, TOOLBAR_EDIT,
hotlist_window.toolbar == NULL);
ro_gui_menu_set_entry_ticked(hotlist_window.menu, TOOLBAR_EDIT,
(hotlist_window.toolbar != NULL &&
- hotlist_window.toolbar->editor));
+ hotlist_window.toolbar->editor != NULL));
ro_gui_save_prepare(GUI_SAVE_HOTLIST_EXPORT_HTML,
NULL, NULL, NULL, NULL);
@@ -341,6 +345,14 @@
case TREE_CLEAR_SELECTION:
hotlist_clear_selection();
return true;
+ case TOOLBAR_BUTTONS:
+ hotlist_window.toolbar->display_buttons =
+ !hotlist_window.toolbar->display_buttons;
+ ro_gui_theme_refresh_toolbar(hotlist_window.toolbar);
+ return true;
+ case TOOLBAR_EDIT:
+ ro_gui_theme_toggle_edit(hotlist_window.toolbar);
+ return true;
default:
return false;
}
@@ -350,11 +362,17 @@
/**
* Update the theme details of the hotlist window.
- */
-
-void ro_gui_hotlist_update_theme(void)
-{
- ro_treeview_update_theme(hotlist_window.tv);
+ *
+ * \param full_update true to force a full theme change; false to
+ * refresh the toolbar size.
+ */
+
+void ro_gui_hotlist_update_theme(bool full_update)
+{
+ if (full_update)
+ ro_treeview_update_theme(hotlist_window.tv);
+ else
+ ro_treeview_update_toolbar(hotlist_window.tv);
}
/**
Modified: trunk/netsurf/riscos/hotlist.h
URL: http://source.netsurf-browser.org/trunk/netsurf/riscos/hotlist.h?rev=1090...
==============================================================================
--- trunk/netsurf/riscos/hotlist.h (original)
+++ trunk/netsurf/riscos/hotlist.h Sun Oct 24 16:52:16 2010
@@ -28,7 +28,7 @@
void ro_gui_hotlist_postinitialise(void);
void ro_gui_hotlist_open(void);
void ro_gui_hotlist_save(void);
-void ro_gui_hotlist_update_theme(void);
+void ro_gui_hotlist_update_theme(bool full_update);
bool ro_gui_hotlist_check_window(wimp_w window);
bool ro_gui_hotlist_check_menu(wimp_menu *menu);
bool ro_gui_hotlist_toolbar_click(wimp_pointer *pointer);
Modified: trunk/netsurf/riscos/menus.c
URL: http://source.netsurf-browser.org/trunk/netsurf/riscos/menus.c?rev=10907&...
==============================================================================
--- trunk/netsurf/riscos/menus.c (original)
+++ trunk/netsurf/riscos/menus.c Sun Oct 24 16:52:16 2010
@@ -101,7 +101,6 @@
static void ro_gui_menu_prepare_pageinfo(struct gui_window *g);
static void ro_gui_menu_prepare_objectinfo(hlcache_handle *object,
const char *href);
-static void ro_gui_menu_refresh_toolbar(struct toolbar *toolbar);
static bool ro_gui_menu_translate(struct menu_definition *menu);
@@ -756,44 +755,6 @@
/**
- * Refresh a toolbar after it has been updated
- *
- * \param toolbar the toolbar to update
- */
-void ro_gui_menu_refresh_toolbar(struct toolbar *toolbar)
-{
-// struct treeview_window *treeview_window;
-
- assert(toolbar);
-
- toolbar->reformat_buttons = true;
- ro_gui_theme_process_toolbar(toolbar, -1);
- if (toolbar->type == THEME_BROWSER_TOOLBAR) {
- gui_window_update_extent(ro_gui_window_lookup(
- current_menu_window));
-// } else if (toolbar->type == THEME_HOTLIST_TOOLBAR) {
-// treeview_window = ro_gui_hotlist_get();
-// /* TODO: FIX THIS */
-// /* tree_resized(treeview_window->tree); */
-// xwimp_force_redraw(treeview_window->window,
-// 0,-16384, 16384, 16384);
-// } else if (toolbar->type == THEME_HISTORY_TOOLBAR) {
-// treeview_window = ro_gui_global_history_get();
-// /* TODO: FIX THIS */
-// /* tree_resized(treeview_window->tree); */
-// xwimp_force_redraw(treeview_window->window,
-// 0,-16384, 16384, 16384);
-// } else if (toolbar->type == THEME_COOKIES_TOOLBAR) {
-// treeview_window = ro_gui_cookies_get();
-// /* TODO: FIX THIS */
-// /* tree_resized(treeview_window->tree); */
-// xwimp_force_redraw(treeview_window->window,
-// 0,-16384, 16384, 16384);
- }
-}
-
-
-/**
* Update navigate menu status and toolbar icons.
*
* /param gui the gui_window to update
@@ -896,7 +857,7 @@
mime = content_get_mime_type(object);
if (mime == NULL)
mime = "-";
-
+
if (href)
target = href;
@@ -1688,19 +1649,19 @@
case TOOLBAR_BUTTONS:
assert(t);
t->display_buttons = !t->display_buttons;
- ro_gui_menu_refresh_toolbar(t);
+ ro_gui_theme_refresh_toolbar(t);
return true;
case TOOLBAR_ADDRESS_BAR:
assert(t);
t->display_url = !t->display_url;
- ro_gui_menu_refresh_toolbar(t);
+ ro_gui_theme_refresh_toolbar(t);
if (t->display_url)
ro_gui_set_caret_first(t->toolbar_handle);
return true;
case TOOLBAR_THROBBER:
assert(t);
t->display_throbber = !t->display_throbber;
- ro_gui_menu_refresh_toolbar(t);
+ ro_gui_theme_refresh_toolbar(t);
return true;
case TOOLBAR_EDIT:
assert(t);
Modified: trunk/netsurf/riscos/theme.c
URL: http://source.netsurf-browser.org/trunk/netsurf/riscos/theme.c?rev=10907&...
==============================================================================
--- trunk/netsurf/riscos/theme.c (original)
+++ trunk/netsurf/riscos/theme.c Sun Oct 24 16:52:16 2010
@@ -588,9 +588,9 @@
/* apply the theme to all the current windows */
ro_gui_window_update_theme();
- ro_gui_cookies_update_theme();
- ro_gui_global_history_update_theme();
- ro_gui_hotlist_update_theme();
+ ro_gui_cookies_update_theme(true);
+ ro_gui_global_history_update_theme(true);
+ ro_gui_hotlist_update_theme(true);
ro_gui_theme_close(theme_previous, false);
return true;
}
@@ -1600,6 +1600,30 @@
/**
+ * Refresh a toolbar after it has been updated
+ *
+ * \param toolbar the toolbar to update
+ */
+void ro_gui_theme_refresh_toolbar(struct toolbar *toolbar)
+{
+ assert(toolbar);
+
+ toolbar->reformat_buttons = true;
+ ro_gui_theme_process_toolbar(toolbar, -1);
+ if (toolbar->type == THEME_BROWSER_TOOLBAR) {
+ gui_window_update_extent(ro_gui_window_lookup(
+ current_menu_window));
+ } else if (toolbar->type == THEME_HOTLIST_TOOLBAR) {
+ ro_gui_hotlist_update_theme(false);
+ } else if (toolbar->type == THEME_HISTORY_TOOLBAR) {
+ ro_gui_global_history_update_theme(false);
+ } else if (toolbar->type == THEME_COOKIES_TOOLBAR) {
+ ro_gui_cookies_update_theme(false);
+ }
+}
+
+
+/**
* Toggles the toolbar editing mode
*
* \param toolbar the toolbar to toggle editing for
Modified: trunk/netsurf/riscos/theme.h
URL: http://source.netsurf-browser.org/trunk/netsurf/riscos/theme.h?rev=10907&...
==============================================================================
--- trunk/netsurf/riscos/theme.h (original)
+++ trunk/netsurf/riscos/theme.h Sun Oct 24 16:52:16 2010
@@ -163,6 +163,7 @@
bool ro_gui_theme_attach_toolbar(struct toolbar *toolbar, wimp_w parent);
bool ro_gui_theme_process_toolbar(struct toolbar *toolbar, int width);
void ro_gui_theme_destroy_toolbar(struct toolbar *toolbar);
+void ro_gui_theme_refresh_toolbar(struct toolbar *toolbar);
void ro_gui_theme_toggle_edit(struct toolbar *toolbar);
void ro_gui_theme_toolbar_editor_sync(struct toolbar *toolbar);
Modified: trunk/netsurf/riscos/treeview.c
URL: http://source.netsurf-browser.org/trunk/netsurf/riscos/treeview.c?rev=109...
==============================================================================
--- trunk/netsurf/riscos/treeview.c (original)
+++ trunk/netsurf/riscos/treeview.c Sun Oct 24 16:52:16 2010
@@ -933,14 +933,25 @@
/* \todo -- Check for toolbar editing here. */
ro_gui_theme_attach_toolbar(tv->tb, tv->w);
+ ro_treeview_update_toolbar(tv);
+ }
+}
+
+
+/**
+ * Change the size of a treeview's toolbar and redraw the window.
+ *
+ * \param *tv The treeview to update.
+ */
+
+void ro_treeview_update_toolbar(ro_treeview *tv)
+{
ro_treeview_set_origin(tv, 0,
-(ro_gui_theme_toolbar_height(tv->tb)));
xwimp_force_redraw(tv->w, 0, tv->extent.y, tv->extent.x, 0);
- }
-}
-
-
+
+}
#if 0
if ((tree) && (tree->toolbar)) {
Modified: trunk/netsurf/riscos/treeview.h
URL: http://source.netsurf-browser.org/trunk/netsurf/riscos/treeview.h?rev=109...
==============================================================================
--- trunk/netsurf/riscos/treeview.h (original)
+++ trunk/netsurf/riscos/treeview.h Sun Oct 24 16:52:16 2010
@@ -47,6 +47,7 @@
void ro_treeview_set_origin(ro_treeview *tv, int x, int y);
void ro_treeview_mouse_at(wimp_w w, wimp_pointer *pointer);
void ro_treeview_update_theme(ro_treeview *tv);
+void ro_treeview_update_toolbar(ro_treeview *tv);
int ro_treeview_get_help(help_full_message_request *message_data);
#endif
12Â years, 7Â months
r10906 stevef - in /trunk/netsurf/riscos: cookies.c cookies.h global_history.c global_history.h hotlist.c hotlist.h theme.c treeview.c treeview.h
by netsurfï¼ semichrome.net
Author: stevef
Date: Sun Oct 24 15:00:45 2010
New Revision: 10906
URL: http://source.netsurf-browser.org?rev=10906&view=rev
Log:
Partially re-enable toolbar buttons in RO treeview windows.
Modified:
trunk/netsurf/riscos/cookies.c
trunk/netsurf/riscos/cookies.h
trunk/netsurf/riscos/global_history.c
trunk/netsurf/riscos/global_history.h
trunk/netsurf/riscos/hotlist.c
trunk/netsurf/riscos/hotlist.h
trunk/netsurf/riscos/theme.c
trunk/netsurf/riscos/treeview.c
trunk/netsurf/riscos/treeview.h
Modified: trunk/netsurf/riscos/cookies.c
URL: http://source.netsurf-browser.org/trunk/netsurf/riscos/cookies.c?rev=1090...
==============================================================================
--- trunk/netsurf/riscos/cookies.c (original)
+++ trunk/netsurf/riscos/cookies.c Sun Oct 24 15:00:45 2010
@@ -150,6 +150,53 @@
}
}
+
+/**
+ * Handle Mouse Click events on the toolbar.
+ *
+ * \param *pointer Pointer to the Mouse Click Event block.
+ * \return Return true if click handled; else false.
+ */
+
+bool ro_gui_cookies_toolbar_click(wimp_pointer *pointer)
+{
+ switch (pointer->i) {
+ case ICON_TOOLBAR_DELETE:
+ if (pointer->buttons == wimp_CLICK_SELECT) {
+ cookies_delete_selected();
+ return true;
+ }
+ break;
+ case ICON_TOOLBAR_EXPAND:
+ if (pointer->buttons == wimp_CLICK_SELECT) {
+ cookies_expand_cookies();
+ return true;
+ } else if (pointer->buttons == wimp_CLICK_ADJUST) {
+ cookies_collapse_cookies();
+ return true;
+ }
+ break;
+ case ICON_TOOLBAR_OPEN:
+ if (pointer->buttons == wimp_CLICK_SELECT) {
+ cookies_expand_domains();
+ return true;
+ } else if (pointer->buttons == wimp_CLICK_ADJUST) {
+ cookies_collapse_domains();
+ return true;
+ }
+ break;
+ }
+
+ /* \todo -- We assume that the owning module will have attached a window menu
+ * to our parent window. If it hasn't, this call will quietly fail.
+ */
+
+ if (pointer->buttons == wimp_CLICK_MENU)
+ return ro_gui_wimp_event_process_window_menu_click(pointer);
+
+ return false;
+}
+
/**
* Prepare the cookies menu for opening
*
Modified: trunk/netsurf/riscos/cookies.h
URL: http://source.netsurf-browser.org/trunk/netsurf/riscos/cookies.h?rev=1090...
==============================================================================
--- trunk/netsurf/riscos/cookies.h (original)
+++ trunk/netsurf/riscos/cookies.h Sun Oct 24 15:00:45 2010
@@ -28,6 +28,7 @@
void ro_gui_cookies_postinitialise(void);
bool ro_gui_cookies_check_window(wimp_w window);
bool ro_gui_cookies_check_menu(wimp_menu *menu);
+bool ro_gui_cookies_toolbar_click(wimp_pointer *pointer);
void ro_gui_cookies_open(void);
void ro_gui_cookies_update_theme(void);
Modified: trunk/netsurf/riscos/global_history.c
URL: http://source.netsurf-browser.org/trunk/netsurf/riscos/global_history.c?r...
==============================================================================
--- trunk/netsurf/riscos/global_history.c (original)
+++ trunk/netsurf/riscos/global_history.c Sun Oct 24 15:00:45 2010
@@ -159,6 +159,59 @@
}
/**
+ * Handle Mouse Click events on the toolbar.
+ *
+ * \param *pointer Pointer to the Mouse Click Event block.
+ * \return Return true if click handled; else false.
+ */
+
+bool ro_gui_global_history_toolbar_click(wimp_pointer *pointer)
+{
+ switch (pointer->i) {
+ case ICON_TOOLBAR_DELETE:
+ if (pointer->buttons == wimp_CLICK_SELECT) {
+ history_global_delete_selected();
+ return true;
+ }
+ break;
+ case ICON_TOOLBAR_EXPAND:
+ if (pointer->buttons == wimp_CLICK_SELECT) {
+ history_global_expand_addresses();
+ return true;
+ } else if (pointer->buttons == wimp_CLICK_ADJUST) {
+ history_global_collapse_addresses();
+ return true;
+ }
+ break;
+ case ICON_TOOLBAR_OPEN:
+ if (pointer->buttons == wimp_CLICK_SELECT) {
+ history_global_expand_directories();
+ return true;
+ } else if (pointer->buttons == wimp_CLICK_ADJUST) {
+ history_global_collapse_directories();
+ return true;
+ }
+ break;
+ case ICON_TOOLBAR_LAUNCH:
+ if (pointer->buttons == wimp_CLICK_SELECT) {
+ history_global_launch_selected();
+ return true;
+ }
+ break;
+ }
+
+ /* \todo -- We assume that the owning module will have attached a window menu
+ * to our parent window. If it hasn't, this call will quietly fail.
+ */
+
+ if (pointer->buttons == wimp_CLICK_MENU)
+ return ro_gui_wimp_event_process_window_menu_click(pointer);
+
+ return true;
+}
+
+
+/**
* Prepare the global history menu for opening
*
* \param window The window owning the menu.
Modified: trunk/netsurf/riscos/global_history.h
URL: http://source.netsurf-browser.org/trunk/netsurf/riscos/global_history.h?r...
==============================================================================
--- trunk/netsurf/riscos/global_history.h (original)
+++ trunk/netsurf/riscos/global_history.h Sun Oct 24 15:00:45 2010
@@ -31,6 +31,7 @@
void ro_gui_global_history_update_theme(void);
bool ro_gui_global_history_check_window(wimp_w window);
bool ro_gui_global_history_check_menu(wimp_menu *menu);
+bool ro_gui_global_history_toolbar_click(wimp_pointer *pointer);
#endif
Modified: trunk/netsurf/riscos/hotlist.c
URL: http://source.netsurf-browser.org/trunk/netsurf/riscos/hotlist.c?rev=1090...
==============================================================================
--- trunk/netsurf/riscos/hotlist.c (original)
+++ trunk/netsurf/riscos/hotlist.c Sun Oct 24 15:00:45 2010
@@ -173,6 +173,68 @@
}
/**
+ * Handle Mouse Click events on the toolbar.
+ *
+ * \param *pointer Pointer to the Mouse Click Event block.
+ * \return Return true if click handled; else false.
+ */
+
+bool ro_gui_hotlist_toolbar_click(wimp_pointer *pointer)
+{
+ LOG(("Entering hotlist toolbar handler: b=%d, i=%d", pointer->buttons, pointer->i));
+
+ switch (pointer->i) {
+ case ICON_TOOLBAR_DELETE:
+ if (pointer->buttons == wimp_CLICK_SELECT) {
+ hotlist_delete_selected();
+ return true;
+ }
+ break;
+ case ICON_TOOLBAR_EXPAND:
+ if (pointer->buttons == wimp_CLICK_SELECT) {
+ hotlist_expand_addresses();
+ return true;
+ } else if (pointer->buttons == wimp_CLICK_ADJUST) {
+ hotlist_collapse_addresses();
+ return true;
+ }
+ break;
+ case ICON_TOOLBAR_OPEN:
+ if (pointer->buttons == wimp_CLICK_SELECT) {
+ hotlist_expand_directories();
+ return true;
+ } else if (pointer->buttons == wimp_CLICK_ADJUST) {
+ hotlist_collapse_directories();
+ return true;
+ }
+ break;
+ case ICON_TOOLBAR_LAUNCH:
+ if (pointer->buttons == wimp_CLICK_SELECT) {
+ hotlist_launch_selected();
+ return true;
+ }
+ break;
+ case ICON_TOOLBAR_CREATE:
+ if (pointer->buttons == wimp_CLICK_SELECT) {
+ hotlist_add_folder();
+ return true;
+ }
+ break;
+ }
+
+
+ /* \todo -- We assume that the owning module will have attached a window menu
+ * to our parent window. If it hasn't, this call will quietly fail.
+ */
+
+ if (pointer->buttons == wimp_CLICK_MENU)
+ return ro_gui_wimp_event_process_window_menu_click(pointer);
+
+ return true;
+}
+
+
+/**
* Prepare the hotlist menu for opening
*
* \param window The window owning the menu.
Modified: trunk/netsurf/riscos/hotlist.h
URL: http://source.netsurf-browser.org/trunk/netsurf/riscos/hotlist.h?rev=1090...
==============================================================================
--- trunk/netsurf/riscos/hotlist.h (original)
+++ trunk/netsurf/riscos/hotlist.h Sun Oct 24 15:00:45 2010
@@ -31,6 +31,7 @@
void ro_gui_hotlist_update_theme(void);
bool ro_gui_hotlist_check_window(wimp_w window);
bool ro_gui_hotlist_check_menu(wimp_menu *menu);
+bool ro_gui_hotlist_toolbar_click(wimp_pointer *pointer);
#endif
Modified: trunk/netsurf/riscos/theme.c
URL: http://source.netsurf-browser.org/trunk/netsurf/riscos/theme.c?rev=10906&...
==============================================================================
--- trunk/netsurf/riscos/theme.c (original)
+++ trunk/netsurf/riscos/theme.c Sun Oct 24 15:00:45 2010
@@ -949,12 +949,18 @@
break;
case THEME_HOTLIST_TOOLBAR:
case THEME_HOTLIST_EDIT_TOOLBAR:
+ ro_gui_wimp_event_register_mouse_click(toolbar->toolbar_handle,
+ ro_gui_hotlist_toolbar_click);
+ break;
case THEME_HISTORY_TOOLBAR:
case THEME_HISTORY_EDIT_TOOLBAR:
+ ro_gui_wimp_event_register_mouse_click(toolbar->toolbar_handle,
+ ro_gui_global_history_toolbar_click);
+ break;
case THEME_COOKIES_TOOLBAR:
case THEME_COOKIES_EDIT_TOOLBAR:
ro_gui_wimp_event_register_mouse_click(toolbar->toolbar_handle,
- ro_gui_treeview_toolbar_click);
+ ro_gui_cookies_toolbar_click);
break;
default:
break;
Modified: trunk/netsurf/riscos/treeview.c
URL: http://source.netsurf-browser.org/trunk/netsurf/riscos/treeview.c?rev=109...
==============================================================================
--- trunk/netsurf/riscos/treeview.c (original)
+++ trunk/netsurf/riscos/treeview.c Sun Oct 24 15:00:45 2010
@@ -172,8 +172,6 @@
ro_gui_wimp_event_register_keypress(tv->w, ro_treeview_keypress);
ro_gui_wimp_event_set_user_data(tv->w, tv);
- /* \todo Register wimp events to handle the supplied toolbar? */
-
return tv;
}
@@ -915,41 +913,6 @@
return false;
}
-/** Respond to a mouse click on a treeview toolbar.
- *
- * \param pointer Pointer to the MouseClick Event block.
- * \return true if the event was handled; else false.
- */
-
-bool ro_gui_treeview_toolbar_click(wimp_pointer *pointer)
-{
- struct toolbar *tb;
- ro_treeview *tv;
-
- tb = (struct toolbar *) ro_gui_wimp_event_get_user_data(pointer->w);
- if (tb == NULL) {
- LOG(("NULL toolbar block for window: 0x%x",
- (unsigned int) pointer->w));
- return false;
- }
-
- tv = (ro_treeview *) ro_gui_wimp_event_get_user_data(tb->parent_handle);
- if (tv == NULL) {
- LOG(("NULL treeview block for parent window: 0x%x",
- (unsigned int) tb->parent_handle));
- return false;
- }
-
- /* \todo -- Handle menu clicks here... */
-
- /* \todo -- Deal with the editor here... */
-
- switch (pointer->i) {
-
- }
-
- return true;
-}
/**
* Update a treeview to use a new theme.
Modified: trunk/netsurf/riscos/treeview.h
URL: http://source.netsurf-browser.org/trunk/netsurf/riscos/treeview.h?rev=109...
==============================================================================
--- trunk/netsurf/riscos/treeview.h (original)
+++ trunk/netsurf/riscos/treeview.h Sun Oct 24 15:00:45 2010
@@ -46,7 +46,6 @@
void ro_treeview_set_origin(ro_treeview *tv, int x, int y);
void ro_treeview_mouse_at(wimp_w w, wimp_pointer *pointer);
-bool ro_gui_treeview_toolbar_click(wimp_pointer *pointer);
void ro_treeview_update_theme(ro_treeview *tv);
int ro_treeview_get_help(help_full_message_request *message_data);
12Â years, 7Â months
r10905 chris_y - /trunk/netsurf/amiga/clipboard.c
by netsurfï¼ semichrome.net
Author: chris_y
Date: Sun Oct 24 13:07:11 2010
New Revision: 10905
URL: http://source.netsurf-browser.org?rev=10905&view=rev
Log:
Selection drags now use clipboard unit 1 instead of 0. This stops the user's
clipboard being unexpectedly changed.
Modified:
trunk/netsurf/amiga/clipboard.c
Modified: trunk/netsurf/amiga/clipboard.c
URL: http://source.netsurf-browser.org/trunk/netsurf/amiga/clipboard.c?rev=109...
==============================================================================
--- trunk/netsurf/amiga/clipboard.c (original)
+++ trunk/netsurf/amiga/clipboard.c Sun Oct 24 13:07:11 2010
@@ -43,21 +43,35 @@
bool ami_add_to_clipboard(const char *text, size_t length, bool space);
+struct IFFHandle *ami_clipboard_init_internal(int unit)
+{
+ struct IFFHandle *iffhandle = NULL;
+
+ if(iffhandle = AllocIFF())
+ {
+ if(iffhandle->iff_Stream = (ULONG)OpenClipboard(unit))
+ {
+ InitIFFasClip(iffhandle);
+ }
+ }
+
+ return iffhandle;
+}
+
void ami_clipboard_init(void)
{
- if(iffh = AllocIFF())
- {
- if(iffh->iff_Stream = (ULONG)OpenClipboard(0))
- {
- InitIFFasClip(iffh);
- }
- }
+ iffh = ami_clipboard_init_internal(0);
+}
+
+void ami_clipboard_free_internal(struct IFFHandle *iffhandle)
+{
+ if(iffhandle->iff_Stream) CloseClipboard((struct ClipboardHandle *)iffhandle->iff_Stream);
+ if(iffhandle) FreeIFF(iffhandle);
}
void ami_clipboard_free(void)
{
- if(iffh->iff_Stream) CloseClipboard((struct ClipboardHandle *)iffh->iff_Stream);
- if(iffh) FreeIFF(iffh);
+ ami_clipboard_free_internal(iffh);
}
void gui_start_selection(struct gui_window *g)
@@ -263,6 +277,7 @@
struct box *text_box;
ULONG x;
ULONG y;
+ struct IFFHandle *old_iffh = iffh;
struct gui_window_2 *gwin = ami_window_at_pointer();
if(!gwin)
@@ -276,11 +291,16 @@
if(text_box = ami_text_box_at_point(gwin, &x, &y))
{
+ iffh = ami_clipboard_init_internal(1);
+
if(gui_copy_to_clipboard(s))
{
browser_window_mouse_click(gwin->bw, BROWSER_MOUSE_PRESS_1, x, y);
browser_window_key_press(gwin->bw, KEY_PASTE);
}
+
+ ami_clipboard_free_internal(iffh);
+ iffh = old_iffh;
}
else
{
12Â years, 7Â months
r10904 chris_y - in /trunk/netsurf/amiga: download.c download.h gui.c gui.h tree.c
by netsurfï¼ semichrome.net
Author: chris_y
Date: Sun Oct 24 12:51:00 2010
New Revision: 10904
URL: http://source.netsurf-browser.org?rev=10904&view=rev
Log:
Only allow auto-scroll on selection and selection drags
Modified:
trunk/netsurf/amiga/download.c
trunk/netsurf/amiga/download.h
trunk/netsurf/amiga/gui.c
trunk/netsurf/amiga/gui.h
trunk/netsurf/amiga/tree.c
Modified: trunk/netsurf/amiga/download.c
URL: http://source.netsurf-browser.org/trunk/netsurf/amiga/download.c?rev=1090...
==============================================================================
--- trunk/netsurf/amiga/download.c (original)
+++ trunk/netsurf/amiga/download.c Sun Oct 24 12:51:00 2010
@@ -369,6 +369,7 @@
{
ami_drag_icon_show(g->shared->win, "ascii");
+ ami_autoscroll = TRUE;
drag_save_data = s;
drag_save = GUI_SAVE_TEXT_SELECTION;
}
@@ -380,7 +381,8 @@
char *source_data;
ULONG source_size;
- if(drag_icon) ami_drag_icon_close();
+ if(drag_icon) ami_drag_icon_close(NULL);
+ ami_autoscroll = FALSE;
if(strcmp(option_use_pubscreen,"Workbench") == 0)
{
@@ -554,9 +556,16 @@
drag_icon_width, drag_icon_height);
}
-void ami_drag_icon_close(void)
+/**
+ * Close the drag icon (invisible) window if it is open
+ *
+ * \param win pointer to window to clear drag pointer
+ */
+
+void ami_drag_icon_close(struct Window *win)
{
if(drag_icon) CloseWindow(drag_icon);
+ if(win) ami_update_pointer(win, GUI_POINTER_DEFAULT);
drag_icon = NULL;
}
Modified: trunk/netsurf/amiga/download.h
URL: http://source.netsurf-browser.org/trunk/netsurf/amiga/download.h?rev=1090...
==============================================================================
--- trunk/netsurf/amiga/download.h (original)
+++ trunk/netsurf/amiga/download.h Sun Oct 24 12:51:00 2010
@@ -50,7 +50,7 @@
BOOL ami_download_window_event(struct gui_download_window *dw);
void ami_drag_save(struct Window *win);
void ami_drag_icon_show(struct Window *win, char *type);
-void ami_drag_icon_close(void);
+void ami_drag_icon_close(struct Window *win);
void ami_drag_icon_move(void);
void ami_free_download_list(struct List *dllist);
void ami_superimpose_favicon(STRPTR path, struct hlcache_handle *icon, STRPTR type);
Modified: trunk/netsurf/amiga/gui.c
URL: http://source.netsurf-browser.org/trunk/netsurf/amiga/gui.c?rev=10904&r1=...
==============================================================================
--- trunk/netsurf/amiga/gui.c (original)
+++ trunk/netsurf/amiga/gui.c Sun Oct 24 12:51:00 2010
@@ -1027,7 +1027,9 @@
width=bbox->Width;
height=bbox->Height;
- if(gwin->mouse_state & BROWSER_MOUSE_DRAG_ON)
+ if(gwin->mouse_state & BROWSER_MOUSE_DRAG_ON &&
+ ((gwin->bw->drag_type == DRAGGING_SELECTION) ||
+ ami_autoscroll == TRUE))
{
int drag_x_move = 0, drag_y_move = 0;
Modified: trunk/netsurf/amiga/gui.h
URL: http://source.netsurf-browser.org/trunk/netsurf/amiga/gui.h?rev=10904&r1=...
==============================================================================
--- trunk/netsurf/amiga/gui.h (original)
+++ trunk/netsurf/amiga/gui.h Sun Oct 24 12:51:00 2010
@@ -145,4 +145,5 @@
struct browser_window *curbw;
struct gui_globals browserglob;
uint32 ami_appid;
+BOOL ami_autoscroll;
#endif
Modified: trunk/netsurf/amiga/tree.c
URL: http://source.netsurf-browser.org/trunk/netsurf/amiga/tree.c?rev=10904&r1...
==============================================================================
--- trunk/netsurf/amiga/tree.c (original)
+++ trunk/netsurf/amiga/tree.c Sun Oct 24 12:51:00 2010
@@ -50,6 +50,8 @@
#include "desktop/history_global_core.h"
#include "desktop/hotlist.h"
#include "amiga/sslcert.h"
+#include "amiga/download.h" /* drag icon stuff */
+#include "amiga/theme.h" /* pointers */
#include "utils/utils.h"
#define AMI_TREE_MENU_ITEMS 19
@@ -793,6 +795,7 @@
}
else
{
+ ami_drag_icon_close(twin->win);
tree_drag_end(twin->tree, twin->mouse_state,
twin->drag_x, twin->drag_y, x, y);
}
@@ -808,6 +811,7 @@
}
else
{
+ ami_drag_icon_close(twin->win);
tree_drag_end(twin->tree, twin->mouse_state,
twin->drag_x, twin->drag_y, x, y);
}
12Â years, 7Â months
r10902 chris_y - /trunk/netsurf/desktop/history_global_core.c
by netsurfï¼ semichrome.net
Author: chris_y
Date: Sun Oct 24 11:24:37 2010
New Revision: 10902
URL: http://source.netsurf-browser.org?rev=10902&view=rev
Log:
Don't expand the oldest global history entries by default.
Modified:
trunk/netsurf/desktop/history_global_core.c
Modified: trunk/netsurf/desktop/history_global_core.c
URL: http://source.netsurf-browser.org/trunk/netsurf/desktop/history_global_co...
==============================================================================
--- trunk/netsurf/desktop/history_global_core.c (original)
+++ trunk/netsurf/desktop/history_global_core.c Sun Oct 24 11:24:37 2010
@@ -299,11 +299,6 @@
global_history_initialised = false;
tree_set_node_expanded(global_history_tree, global_history_tree_root,
false, true, true);
- first = tree_node_get_child(global_history_tree_root);
- if (first != NULL)
- tree_set_node_expanded(global_history_tree, first,
- true, false, false);
-
return true;
}
12Â years, 7Â months