Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ bin_*
mcp/locale.*
MEMORY.md
.DS_Store
mcc/amissl_sdk/
3 changes: 2 additions & 1 deletion AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

HTMLview.mcc - HTMLview MUI Custom Class
Copyright (C) 1997-2000 Allan Odgaard
Copyright (C) 2005-2010 by HTMLview.mcc Open Source Team
Copyright (C) 2005-2026 by HTMLview.mcc Open Source Team

This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
Expand All @@ -25,6 +25,7 @@ design provided by the following people:

Alfonso Ranieri <alforan@tin.it>
Allan Odgaard <duff2@users.sourceforge.net>
Dimitris Panokostas <midwan@gmail.com>
Dwight Meese <ikepgh@suddenlink.net>
Ilkka Lehtoranta <ilkleht@isoveli.org>
Jens Langner <Jens.Langner@light-speed.de>
Expand Down
30 changes: 30 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,36 @@ MUI HTMLview MCC class - ChangeLog
$Id$
$URL$

2026-04-18 Dimitris Panokostas <midwan@gmail.com>

* mcc/test_image_hook.h: HTTPS support via AmiSSL. The shared test-program
image hook now handles https:// URLs and follows http->https redirects
(up to five hops). TLS is wrapped through amisslmaster.library +
amissl.library (jens-maus AmiSSL 5.27 SDK), using the inline macros
against task-local library bases -- no stub lib link and no global
AmiSSLBase symbol required. Certificate verification is currently
VERIFY_NONE; CA bundle wiring is a follow-up.
* mcc/test_image_hook.h: Replaced unbounded sprintf into log buffers with
snprintf; a long Location: header or redirect target could otherwise
overflow the stack log buffer.
* mcc/Makefile: On-demand AmiSSL SDK download (lha xq). HTTPS is enabled
for OS3 and OS4 builds; MorphOS stays on plain HTTP.
* mcc/SimpleTest.c, mcc/LibLoad_Test.c: Added network-image test entries
(plain HTTP from aminet, http->https redirect on amigaworld, direct
HTTPS from aminet).
* mcc/LibLoad_Test.c: New test program that exercises the same hook as
SimpleTest but through dlopen-style library loading, making it easier
to verify the shipped HTMLview.mcc on each platform.

2026-04-17 Dimitris Panokostas <midwan@gmail.com>

* mcc: Fix MorphOS MCP and OS4 MCC build issues; OS4 build now makes
-ldebug conditional and stubs kprintf when not building with DEBUG=1;
enabled all three platform builds (OS3, OS4, MorphOS) in CI.
* mcc/ImageManager.cpp, mcc/IM_Render.cpp, mcc/Dispatcher.cpp: Local
image rendering fixes uncovered by the new test programs (decoder
handshake, frame cleanup, hook dispatcher wiring on OS4).

2016-07-29 Thore B�ckelmann <tboeckel@gmx.de>

* mcc: lots of changes to get this beast buildable with our Linux based cross
Expand Down
2 changes: 1 addition & 1 deletion README
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

HTMLview.mcc - HTMLview MUI Custom Class
Copyright (C) 1997-2000 Allan Odgaard
Copyright (C) 2005-2007 by HTMLview.mcc Open Source Team
Copyright (C) 2005-2026 by HTMLview.mcc Open Source Team

This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
Expand Down
2 changes: 1 addition & 1 deletion TODO
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

HTMLview.mcc - HTMLview MUI Custom Class
Copyright (C) 1997-2000 Allan Odgaard
Copyright (C) 2005-2007 by HTMLview.mcc Open Source Team
Copyright (C) 2005-2026 by HTMLview.mcc Open Source Team

This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
Expand Down
12 changes: 12 additions & 0 deletions doc/MCC_HTMLview.doc
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,14 @@ ToDo:
FUNCTION
Setup a hook used for image-loading.

Only the hook performs I/O; HTMLview.mcc itself never
touches the network or the filesystem. The hook therefore
decides which URL schemes are supported. The bundled
SimpleTest / LibLoad_Test programs in mcc/ ship a reference
hook that handles PROGDIR:, file://, http:// and (when
compiled against the AmiSSL SDK) https:// with http->https
redirect following.

SEE ALSO
MUIA_HTMLview_LoadHook

Expand All @@ -160,6 +168,10 @@ ToDo:
FUNCTION
Setup a hook used for (page)-loading.

See MUIA_HTMLview_ImageLoadHook for a note on what the
hook is responsible for and where to find a reference
implementation that also covers HTTPS via AmiSSL.

The hook is called with a pointer to itself in a0, a pointer to a
struct HTMLview_LoadMsg in a1 and a pointer to the calling object in
a2.
Expand Down
2 changes: 1 addition & 1 deletion doc/MCC_HTMLview.readme
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ LEGALESE

HTMLview.mcc was originally written in 1995 and is Copyright (C) 1995-2000
by Allan Odgaard. As of version 13.4, released in December 2007, the gadget is
maintained and Copyright (C) 2005-2007 by the HTMLview.mcc Open Source Team.
maintained and Copyright (C) 2005-2026 by the HTMLview.mcc Open Source Team.

HTMLview.mcc is distributed under the GNU Lesser General Public License
(LGPL) and the development is hosted at SourceForge.net:
Expand Down
11 changes: 11 additions & 0 deletions mcc/HTMLview_mcc.h
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,10 @@
* to itself in a0, a pointer to a struct HTMLview_LoadMsg in a1 and a
* pointer to the calling object in a2.
*
* See MUIA_HTMLview_ImageLoadHook for a note on what the hook is
* responsible for and where to find a reference implementation that
* also covers HTTPS via AmiSSL.
*
* This hook will be called from a separate task, so the only MUI method
* that you can use is MUIM_Application_PushMethod. The hook may very well
* be called by sevaral tasks at the same time, so your code needs to be
Expand Down Expand Up @@ -619,6 +623,13 @@
*
* Setup a hook used for image-loading.
*
* Only the hook performs I/O; HTMLview.mcc itself never touches the
* network or the filesystem. The hook therefore decides which URL
* schemes are supported. The bundled SimpleTest / LibLoad_Test
* programs in mcc/ ship a reference hook that handles PROGDIR:,
* file://, http:// and (when compiled against the AmiSSL SDK)
* https:// with http->https redirect following.
*
* SEE ALSO
*
* MUIA_HTMLview_LoadHook
Expand Down
7 changes: 6 additions & 1 deletion mcc/LibLoad_Test.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,12 @@ static const char *test_html =
"<h2>Images - Network (HTTP)</h2>"
"<p>Network images require bsdsocket.library:</p>"
"<p><img src=\"http://aminet.net/pics/aminet.png\" alt=\"Aminet Logo (HTTP)\"></p>"
"<p><img src=\"http://www.amigaworld.net/images/awn2.gif\" alt=\"AmigaWorld (HTTP)\"></p>"
"<p>Exercises http-&gt;https redirect (requires AmiSSL):</p>"
"<p><img src=\"http://www.amigaworld.net/themes/default/images/logo-top.gif\" alt=\"AmigaWorld (HTTP redirect)\"></p>"

"<h2>Images - Network (HTTPS)</h2>"
"<p>Direct TLS fetch. Needs amisslmaster.library + amissl.library installed:</p>"
"<p><img src=\"https://aminet.net/pics/aminet.png\" alt=\"Aminet Logo (HTTPS)\"></p>"

"<h2>Text</h2>"
"<p><b>Bold</b>, <i>italic</i>, <u>under</u>, <s>strike</s>, <tt>tt</tt></p>"
Expand Down
62 changes: 58 additions & 4 deletions mcc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,11 @@ endif
LDFLAGS = $(CPU) $(DEBUGSYM)
LDLIBS =

# Per-program extras; populated by the AmiSSL block below.
TEST_CFLAGS =
TEST_LDLIBS =
TEST_DEPS =

# different options per target OS
ifeq ($(OS), os4)

Expand Down Expand Up @@ -241,6 +246,45 @@ endif
endif
endif

###########################################################################
# AmiSSL SDK — enables HTTPS in SimpleTest / LibLoad_Test.
#
# The SDK is downloaded from jens-maus/amissl on first build. Pass
# USE_AMISSL=0 to disable; the test programs then speak plain HTTP only.
# No SDK is distributed for MorphOS, so USE_AMISSL is forced off there.

AMISSL_VERSION ?= 5.27
AMISSL_SDK_DIR ?= amissl_sdk
AMISSL_SDK_READY = $(AMISSL_SDK_DIR)/.ready
AMISSL_INC = $(AMISSL_SDK_DIR)/AmiSSL/Developer/include
AMISSL_URL = https://github.com/jens-maus/amissl/releases/download/$(AMISSL_VERSION)/AmiSSL-$(AMISSL_VERSION)-SDK.lha

ifeq ($(OS), os3)
AMISSL_LIBDIR = $(AMISSL_SDK_DIR)/AmiSSL/Developer/lib/AmigaOS3
USE_AMISSL ?= 1
else ifeq ($(OS), os4)
AMISSL_LIBDIR = $(AMISSL_SDK_DIR)/AmiSSL/Developer/lib/AmigaOS4/newlib
USE_AMISSL ?= 1
else
USE_AMISSL = 0
endif

ifeq ($(USE_AMISSL), 1)
# Headers only: the inline macros in <inline/amissl.h> dispatch through
# a task-local library base, so no stub lib (libamisslstubs.a) is needed
# and there are no global AmiSSLBase / AmiSSLMasterBase symbols to
# satisfy at link time.
TEST_CFLAGS += -DHAVE_AMISSL -I$(AMISSL_INC)
TEST_DEPS += $(AMISSL_SDK_READY)
endif

$(AMISSL_SDK_READY):
@echo " GET AmiSSL SDK $(AMISSL_VERSION)"
@mkdir -p $(AMISSL_SDK_DIR)
@cd $(AMISSL_SDK_DIR) && curl -fsSL -o sdk.lha "$(AMISSL_URL)"
@cd $(AMISSL_SDK_DIR) && lha xq sdk.lha && rm -f sdk.lha
@touch $@

###########################################################################
# Here starts all stuff that is common for all target platforms and
# hosts.
Expand Down Expand Up @@ -447,6 +491,16 @@ $(OBJDIR)/mccclass_68k.o: ../include/mccclass_68k.c
@echo " CC $<"
@$(CC) $(CFLAGS) $< -o $@

# Test programs get the AmiSSL include path (if enabled). The explicit
# rules below shadow the generic %.o: %.c rule so TEST_CFLAGS applies.
$(OBJDIR)/SimpleTest.o: SimpleTest.c test_image_hook.h $(TEST_DEPS)
@echo " CC $<"
@$(CC) $(CFLAGS) $(TEST_CFLAGS) $< -o $@

$(OBJDIR)/LibLoad_Test.o: LibLoad_Test.c test_image_hook.h $(TEST_DEPS)
@echo " CC $<"
@$(CC) $(CFLAGS) $(TEST_CFLAGS) $< -o $@

#

# Link against all MCC objects EXCEPT library.o (globals conflict)
Expand All @@ -456,18 +510,18 @@ LIBOBJS = $(filter-out $(OBJDIR)/library.o $(OBJDIR)/crtclasses_begin.o $(OBJDIR
$(SIMPLETARGET): $(OBJDIR)/SimpleTest.o
@echo " LD $@"
ifneq (,$(DEBUG))
@$(CXX) $(filter-out -nostartfiles,$(LDFLAGS)) -o $@.debug $(OBJDIR)/SimpleTest.o $(LDLIBS) -ldebug -Wl,-Map,$@.map
@$(CXX) $(filter-out -nostartfiles,$(LDFLAGS)) -o $@.debug $(OBJDIR)/SimpleTest.o $(LDLIBS) $(TEST_LDLIBS) -ldebug -Wl,-Map,$@.map
else
@$(CXX) $(filter-out -nostartfiles,$(LDFLAGS)) -o $@.debug $(OBJDIR)/SimpleTest.o $(LDLIBS) -Wl,-Map,$@.map
@$(CXX) $(filter-out -nostartfiles,$(LDFLAGS)) -o $@.debug $(OBJDIR)/SimpleTest.o $(LDLIBS) $(TEST_LDLIBS) -Wl,-Map,$@.map
endif
@$(STRIP) --preserve-dates -R.comment -R.sdata2 -S -o $@ $@.debug

$(LIBLOADTARGET): $(OBJDIR)/LibLoad_Test.o
@echo " LD $@"
ifneq (,$(DEBUG))
@$(CXX) $(filter-out -nostartfiles,$(LDFLAGS)) -o $@.debug $(OBJDIR)/LibLoad_Test.o $(LDLIBS) -ldebug -Wl,-Map,$@.map
@$(CXX) $(filter-out -nostartfiles,$(LDFLAGS)) -o $@.debug $(OBJDIR)/LibLoad_Test.o $(LDLIBS) $(TEST_LDLIBS) -ldebug -Wl,-Map,$@.map
else
@$(CXX) $(filter-out -nostartfiles,$(LDFLAGS)) -o $@.debug $(OBJDIR)/LibLoad_Test.o $(LDLIBS) -Wl,-Map,$@.map
@$(CXX) $(filter-out -nostartfiles,$(LDFLAGS)) -o $@.debug $(OBJDIR)/LibLoad_Test.o $(LDLIBS) $(TEST_LDLIBS) -Wl,-Map,$@.map
endif
@$(STRIP) --preserve-dates -R.comment -R.sdata2 -S -o $@ $@.debug

Expand Down
7 changes: 6 additions & 1 deletion mcc/SimpleTest.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,12 @@ static const char *test_html =
"<h2>Images - Network (HTTP)</h2>"
"<p>These need bsdsocket.library and a working network stack:</p>"
"<p><img src=\"http://aminet.net/pics/aminet.png\" alt=\"Aminet Logo (HTTP)\"></p>"
"<p><img src=\"http://www.amigaworld.net/images/awn2.gif\" alt=\"AmigaWorld (HTTP)\"></p>"
"<p>Exercises http-&gt;https redirect (requires AmiSSL):</p>"
"<p><img src=\"http://www.amigaworld.net/themes/default/images/logo-top.gif\" alt=\"AmigaWorld (HTTP redirect)\"></p>"

"<h2>Images - Network (HTTPS)</h2>"
"<p>Direct TLS fetch. Needs amisslmaster.library + amissl.library installed:</p>"
"<p><img src=\"https://aminet.net/pics/aminet.png\" alt=\"Aminet Logo (HTTPS)\"></p>"

"<h2>Text Formatting</h2>"
"<p><b>Bold text</b>, <i>italic text</i>, "
Expand Down
Loading